feat: add analytics-service (Spring Cloud Gateway + Consul)

This commit is contained in:
2026-02-17 19:53:49 +01:00
parent 008aceb64b
commit 5f314bc00a
22 changed files with 884 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
server:
port: 8082
spring:
application:
name: analytics-service
datasource:
url: jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:appdb}?currentSchema=analytics
username: ${DB_USERNAME:app}
password: ${DB_PASSWORD:}
hikari:
maximum-pool-size: 5
jpa:
hibernate:
ddl-auto: validate
properties:
hibernate:
default_schema: analytics
open-in-view: false
flyway:
enabled: true
schemas: analytics
default-schema: analytics
kafka:
bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVERS:localhost:9092}
consumer:
group-id: analytics-group
auto-offset-reset: earliest
cloud:
consul:
host: ${CONSUL_HOST:localhost}
port: ${CONSUL_PORT:8500}
discovery:
register: true
enabled: true
health-check-path: /actuator/health
health-check-interval: 15s
prefer-ip-address: true
instance-id: ${spring.application.name}:${random.value}
analytics:
kafka:
topic: user-events
management:
endpoints:
web:
exposure:
include: health,info
endpoint:
health:
show-details: always
logging:
level:
root: INFO
com.posthub.analytics: DEBUG