- OpenApiConfig 추가: Swagger UI 기본 설정 및 API 정보 정의 - application.yml: Springdoc 설정 추가 및 웹 로깅 레벨 강화 - DistributionController: Swagger 어노테이션 추가 (@Tag, @Operation, @ApiResponses) - API path 주석 수정: /api prefix 제거하여 실제 경로와 일치
149 lines
4.0 KiB
YAML
149 lines
4.0 KiB
YAML
server:
|
|
port: 8085
|
|
|
|
spring:
|
|
application:
|
|
name: distribution-service
|
|
|
|
# Database Configuration
|
|
datasource:
|
|
driver-class-name: org.postgresql.Driver
|
|
url: jdbc:postgresql://${DB_HOST:4.217.133.59}:${DB_PORT:5432}/${DB_NAME:distributiondb}
|
|
username: ${DB_USERNAME:eventuser}
|
|
password: ${DB_PASSWORD:Hi5Jessica!}
|
|
hikari:
|
|
maximum-pool-size: 10
|
|
minimum-idle: 5
|
|
connection-timeout: 30000
|
|
idle-timeout: 600000
|
|
max-lifetime: 1800000
|
|
|
|
jpa:
|
|
hibernate:
|
|
ddl-auto: ${JPA_DDL_AUTO:update}
|
|
properties:
|
|
hibernate:
|
|
dialect: org.hibernate.dialect.PostgreSQLDialect
|
|
format_sql: true
|
|
show_sql: ${JPA_SHOW_SQL:false}
|
|
|
|
# Redis Configuration
|
|
data:
|
|
redis:
|
|
host: ${REDIS_HOST:20.214.210.71}
|
|
port: ${REDIS_PORT:6379}
|
|
password: ${REDIS_PASSWORD:Hi5Jessica!}
|
|
timeout: 3000ms
|
|
lettuce:
|
|
pool:
|
|
max-active: 8
|
|
max-idle: 8
|
|
min-idle: 2
|
|
|
|
# Disable security auto-configuration
|
|
autoconfigure:
|
|
exclude:
|
|
- org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
|
|
- org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration
|
|
|
|
kafka:
|
|
enabled: ${KAFKA_ENABLED:true}
|
|
bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVERS:4.230.50.63:9092}
|
|
producer:
|
|
key-serializer: org.apache.kafka.common.serialization.StringSerializer
|
|
value-serializer: org.springframework.kafka.support.serializer.JsonSerializer
|
|
properties:
|
|
spring.json.type.mapping: distributionCompleted:com.kt.distribution.event.DistributionCompletedEvent
|
|
consumer:
|
|
group-id: ${KAFKA_CONSUMER_GROUP:distribution-service}
|
|
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
|
value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
|
|
properties:
|
|
spring.json.trusted.packages: '*'
|
|
|
|
# Kafka Topics
|
|
kafka:
|
|
topics:
|
|
distribution-completed: distribution-completed
|
|
|
|
# Resilience4j Configuration
|
|
resilience4j:
|
|
circuitbreaker:
|
|
instances:
|
|
channelApi:
|
|
failure-rate-threshold: 50
|
|
slow-call-rate-threshold: 50
|
|
slow-call-duration-threshold: 5000ms
|
|
wait-duration-in-open-state: 30s
|
|
permitted-number-of-calls-in-half-open-state: 3
|
|
sliding-window-type: COUNT_BASED
|
|
sliding-window-size: 10
|
|
minimum-number-of-calls: 5
|
|
|
|
retry:
|
|
instances:
|
|
channelApi:
|
|
max-attempts: 3
|
|
wait-duration: 1s
|
|
exponential-backoff-multiplier: 2
|
|
retry-exceptions:
|
|
- java.net.SocketTimeoutException
|
|
- java.net.ConnectException
|
|
- org.springframework.web.client.ResourceAccessException
|
|
|
|
bulkhead:
|
|
instances:
|
|
channelApi:
|
|
max-concurrent-calls: 10
|
|
max-wait-duration: 0ms
|
|
|
|
# External Channel APIs (Mock URLs)
|
|
channel:
|
|
apis:
|
|
uridongnetv:
|
|
url: ${URIDONGNETV_API_URL:http://localhost:9001/api/uridongnetv}
|
|
timeout: 10000
|
|
ringobiz:
|
|
url: ${RINGOBIZ_API_URL:http://localhost:9002/api/ringobiz}
|
|
timeout: 10000
|
|
ginitv:
|
|
url: ${GINITV_API_URL:http://localhost:9003/api/ginitv}
|
|
timeout: 10000
|
|
instagram:
|
|
url: ${INSTAGRAM_API_URL:http://localhost:9004/api/instagram}
|
|
timeout: 10000
|
|
naver:
|
|
url: ${NAVER_API_URL:http://localhost:9005/api/naver}
|
|
timeout: 10000
|
|
kakao:
|
|
url: ${KAKAO_API_URL:http://localhost:9006/api/kakao}
|
|
timeout: 10000
|
|
|
|
# Springdoc OpenAPI (Swagger)
|
|
springdoc:
|
|
api-docs:
|
|
path: /v3/api-docs
|
|
enabled: true
|
|
swagger-ui:
|
|
path: /swagger-ui.html
|
|
enabled: true
|
|
operations-sorter: alpha
|
|
tags-sorter: alpha
|
|
display-request-duration: true
|
|
show-actuator: true
|
|
|
|
# Logging
|
|
logging:
|
|
file:
|
|
name: ${LOG_FILE:logs/distribution-service.log}
|
|
logback:
|
|
rollingpolicy:
|
|
max-file-size: 10MB
|
|
max-history: 7
|
|
total-size-cap: 100MB
|
|
level:
|
|
com.kt.distribution: DEBUG
|
|
org.springframework.kafka: INFO
|
|
io.github.resilience4j: DEBUG
|
|
org.springframework.web: DEBUG
|