mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2025-12-06 12:06:24 +00:00
- EventCreatedEvent, EventStats에 startDate, endDate 필드 추가 - EventCreatedConsumer에서 이벤트 시작/종료 날짜 저장 - SampleDataLoader에서 실제 날짜로 이벤트 발행 - evt_2025012301: 2025-01-23 시작 (ACTIVE) - evt_2025020101: 2025-02-01 시작 (ACTIVE) - evt_2025011501: 2025-01-15~2025-01-31 (COMPLETED) - AnalyticsService: 이벤트 시작일~종료일(또는 현재) 기간 계산 - UserAnalyticsService: 가장 빠른 이벤트 시작일~현재 기간 계산 - application.yml에서 중복된 context-path 제거 - Consumer Group ID를 analytics-service-consumers-v3로 통일 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
171 lines
4.7 KiB
YAML
171 lines
4.7 KiB
YAML
spring:
|
|
application:
|
|
name: analytics-service
|
|
|
|
# Database
|
|
datasource:
|
|
url: jdbc:postgresql://${DB_HOST:4.230.49.9}:${DB_PORT:5432}/${DB_NAME:analytics_db}
|
|
username: ${DB_USERNAME:analytics_user}
|
|
password: ${DB_PASSWORD:analytics_pass}
|
|
driver-class-name: org.postgresql.Driver
|
|
hikari:
|
|
maximum-pool-size: 20
|
|
minimum-idle: 5
|
|
connection-timeout: 30000
|
|
idle-timeout: 600000
|
|
max-lifetime: 1800000
|
|
leak-detection-threshold: 60000
|
|
|
|
# JPA
|
|
jpa:
|
|
show-sql: ${SHOW_SQL:true}
|
|
properties:
|
|
hibernate:
|
|
format_sql: true
|
|
use_sql_comments: true
|
|
dialect: org.hibernate.dialect.PostgreSQLDialect
|
|
hibernate:
|
|
ddl-auto: ${DDL_AUTO:update}
|
|
|
|
# Redis
|
|
data:
|
|
redis:
|
|
host: ${REDIS_HOST:20.214.210.71}
|
|
port: ${REDIS_PORT:6379}
|
|
password: ${REDIS_PASSWORD:Hi5Jessica!}
|
|
timeout: 2000ms
|
|
lettuce:
|
|
pool:
|
|
max-active: 8
|
|
max-idle: 8
|
|
min-idle: 0
|
|
max-wait: -1ms
|
|
database: ${REDIS_DATABASE:5}
|
|
|
|
# Kafka (원격 서버 사용)
|
|
kafka:
|
|
enabled: ${KAFKA_ENABLED:true}
|
|
bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVERS:20.249.182.13:9095,4.217.131.59:9095}
|
|
consumer:
|
|
group-id: ${KAFKA_CONSUMER_GROUP_ID:analytics-service-consumers-v3}
|
|
auto-offset-reset: earliest
|
|
enable-auto-commit: true
|
|
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
|
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
|
properties:
|
|
auto.offset.reset: earliest
|
|
producer:
|
|
key-serializer: org.apache.kafka.common.serialization.StringSerializer
|
|
value-serializer: org.apache.kafka.common.serialization.StringSerializer
|
|
acks: all
|
|
retries: 3
|
|
properties:
|
|
connections.max.idle.ms: 540000
|
|
request.timeout.ms: 30000
|
|
session.timeout.ms: 30000
|
|
heartbeat.interval.ms: 3000
|
|
max.poll.interval.ms: 300000
|
|
|
|
# Sample Data (MVP Only)
|
|
# ⚠️ 실제 운영: false로 설정 (다른 서비스들이 이벤트 발행)
|
|
# ⚠️ MVP 환경: true로 설정 (SampleDataLoader가 이벤트 발행)
|
|
sample-data:
|
|
enabled: ${SAMPLE_DATA_ENABLED:true}
|
|
|
|
# Server
|
|
server:
|
|
port: ${SERVER_PORT:8086}
|
|
servlet:
|
|
encoding:
|
|
charset: UTF-8
|
|
enabled: true
|
|
force: true
|
|
|
|
# JWT
|
|
jwt:
|
|
secret: ${JWT_SECRET:}
|
|
access-token-validity: ${JWT_ACCESS_TOKEN_VALIDITY:1800}
|
|
refresh-token-validity: ${JWT_REFRESH_TOKEN_VALIDITY:86400}
|
|
|
|
# CORS Configuration
|
|
cors:
|
|
allowed-origins: ${CORS_ALLOWED_ORIGINS:http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084,http://kt-event-marketing.20.214.196.128.nip.io}
|
|
allowed-methods: ${CORS_ALLOWED_METHODS:GET,POST,PUT,DELETE,OPTIONS,PATCH}
|
|
allowed-headers: ${CORS_ALLOWED_HEADERS:*}
|
|
allow-credentials: ${CORS_ALLOW_CREDENTIALS:true}
|
|
max-age: ${CORS_MAX_AGE:3600}
|
|
|
|
# Actuator
|
|
management:
|
|
endpoints:
|
|
web:
|
|
exposure:
|
|
include: health,info,metrics,prometheus
|
|
base-path: /actuator
|
|
endpoint:
|
|
health:
|
|
show-details: always
|
|
show-components: always
|
|
health:
|
|
livenessState:
|
|
enabled: true
|
|
readinessState:
|
|
enabled: true
|
|
|
|
# OpenAPI Documentation
|
|
springdoc:
|
|
api-docs:
|
|
path: /v3/api-docs
|
|
swagger-ui:
|
|
path: /swagger-ui.html
|
|
tags-sorter: alpha
|
|
operations-sorter: alpha
|
|
show-actuator: false
|
|
|
|
# Logging
|
|
logging:
|
|
level:
|
|
com.kt.event.analytics: ${LOG_LEVEL_APP:DEBUG}
|
|
org.springframework.web: ${LOG_LEVEL_WEB:INFO}
|
|
org.hibernate.SQL: ${LOG_LEVEL_SQL:DEBUG}
|
|
org.hibernate.type: ${LOG_LEVEL_SQL_TYPE:TRACE}
|
|
pattern:
|
|
console: "%d{yyyy-MM-dd HH:mm:ss} - %msg%n"
|
|
file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
|
file:
|
|
name: ${LOG_FILE:logs/analytics-service.log}
|
|
logback:
|
|
rollingpolicy:
|
|
max-file-size: 10MB
|
|
max-history: 7
|
|
total-size-cap: 100MB
|
|
|
|
# Resilience4j Circuit Breaker
|
|
resilience4j:
|
|
circuitbreaker:
|
|
instances:
|
|
wooriTV:
|
|
failure-rate-threshold: 50
|
|
wait-duration-in-open-state: 30s
|
|
sliding-window-size: 10
|
|
permitted-number-of-calls-in-half-open-state: 3
|
|
genieTV:
|
|
failure-rate-threshold: 50
|
|
wait-duration-in-open-state: 30s
|
|
sliding-window-size: 10
|
|
ringoBiz:
|
|
failure-rate-threshold: 50
|
|
wait-duration-in-open-state: 30s
|
|
sliding-window-size: 10
|
|
sns:
|
|
failure-rate-threshold: 50
|
|
wait-duration-in-open-state: 30s
|
|
sliding-window-size: 10
|
|
|
|
# Batch Scheduler
|
|
batch:
|
|
analytics:
|
|
refresh-interval: ${BATCH_REFRESH_INTERVAL:300000} # 5분 (밀리초)
|
|
initial-delay: ${BATCH_INITIAL_DELAY:30000} # 30초 (밀리초)
|
|
enabled: ${BATCH_ENABLED:true} # 배치 활성화 여부
|