application.yml 2.49 KB
spring:
  application:
    name: notification-service
  profiles:
    active: prod
  datasource:
    url: jdbc:postgresql://postgresql.ecommerce.svc.cluster.local:5432/ecommerce_notifications
    username: ${DB_USERNAME:postgres}
    password: ${DB_PASSWORD:password}
    driver-class-name: org.postgresql.Driver
  jpa:
    hibernate:
      ddl-auto: validate
    properties:
      hibernate:
        dialect: org.hibernate.dialect.PostgreSQLDialect
        show_sql: false
        format_sql: true
        jdbc:
          lob:
            non_contextual_creation: true
  mail:
    host: ${SMTP_HOST:smtp.gmail.com}
    port: ${SMTP_PORT:587}
    username: ${SMTP_USERNAME:your-email@gmail.com}
    password: ${SMTP_PASSWORD:your-app-password}
    properties:
      mail:
        smtp:
          auth: true
          starttls:
            enable: true
        transport:
          protocol: smtp
        debug: false
  rabbitmq:
    host: rabbitmq.ecommerce.svc.cluster.local
    port: 5672
    username: ${RABBITMQ_USERNAME:guest}
    password: ${RABBITMQ_PASSWORD:guest}
    virtual-host: /
    connection-timeout: 5000

server:
  port: 8080
  servlet:
    context-path: /api

eureka:
  client:
    service-url:
      defaultZone: http://service-registry:8761/eureka/
    register-with-eureka: true
    fetch-registry: true

# SMS Configuration
sms:
  provider: ${SMS_PROVIDER:twilio} # twilio, aws_sns, simulation
  twilio:
    account-sid: ${TWILIO_ACCOUNT_SID:default-sid}
    auth-token: ${TWILIO_AUTH_TOKEN:default-token}
    phone-number: ${TWILIO_PHONE_NUMBER:+1234567890}
  aws:
    sns:
      region: ${AWS_SNS_REGION:us-east-1}

# FCM Configuration
fcm:
  server-key: ${FCM_SERVER_KEY:default-key}
  url: ${FCM_URL:https://fcm.googleapis.com/fcm/send}
  service-account-file: ${FCM_SERVICE_ACCOUNT_FILE:firebase-service-account.json}
  database-url: ${FCM_DATABASE_URL:https://your-project-id.firebaseio.com}

management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,prometheus
  endpoint:
    health:
      show-details: always
      show-components: always

logging:
  level:
    com.ecommerce.notification: INFO
    org.springframework.amqp: WARN
    org.hibernate.SQL: WARN
    org.springframework.mail: WARN
  pattern:
    console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"

springdoc:
  api-docs:
    path: /v3/api-docs
  swagger-ui:
    path: /swagger-ui.html
    operations-sorter: method

# Scheduled tasks for processing pending notifications
scheduling:
  enabled: true