### feat: verbessere DI, Healthcheck-Logik und Reiter-API

- **Healthcheck:** Aktualisiere Dockerfile und konsolidiere Ports für konsistente Service-Gesundheitsprüfungen (8086 für Actuator, 8091 für API-Traffic).
- **ReiterRepository:** Implementiere `KtorReiterRepository` zur Nutzung der Backend-Stammdaten über API.
- **DI-Module:** Passe `ReiterModule` und `VereinFeatureModule` an, um den authentifizierten `apiClient` zu verwenden.
- **Masterdata-Service:** Synchronisiere Environment-Variablen und Konsul-Konfiguration mit aktualisierten Ports.
This commit is contained in:
2026-04-22 12:11:33 +02:00
parent e0b1ce8836
commit d4cc0eb77d
9 changed files with 146 additions and 23 deletions
@@ -1,10 +1,13 @@
spring:
application:
name: billing-service
datasource:
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/pg-meldestelle-db}
username: ${SPRING_DATASOURCE_USERNAME:pg-user}
password: ${SPRING_DATASOURCE_PASSWORD:pg-password}
driver-class-name: org.postgresql.Driver
cloud:
consul:
host: ${SPRING_CLOUD_CONSUL_HOST:localhost}
@@ -15,13 +18,19 @@ spring:
prefer-ip-address: true
health-check-path: /actuator/health
health-check-interval: 10s
health-check-port: 8089
# health-check-port: 8089
instance-id: ${spring.application.name}:${server.port}:${random.uuid}
service-name: ${spring.application.name}
port: ${billing.http.port:8089}
server:
port: 8089
billing:
http:
port: 8089 # Ktor API Port (Haupt-Einstiegspunkt für REST-Anfragen)
address: 0.0.0.0 # Öffentlich erreichbar innerhalb des Netzwerks / Containers
management:
endpoints:
web:
@@ -30,3 +39,12 @@ management:
endpoint:
health:
show-details: always
probes:
enabled: true
logging:
level:
root: INFO
# at.mocode.billing: DEBUG
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
+2 -2
View File
@@ -92,8 +92,8 @@ USER ${APP_USER}
EXPOSE 8086 5005
HEALTHCHECK --interval=15s --timeout=3s --start-period=40s --retries=3 \
CMD curl -fsS --max-time 2 http://localhost:8086/actuator/health/readiness || exit 1
HEALTHCHECK --interval=15s --timeout=5s --start-period=60s --retries=5 \
CMD curl -fsS --max-time 5 http://localhost:${SERVER_PORT:-8086}/actuator/health/readiness || exit 1
ENV JAVA_OPTS="-XX:MaxRAMPercentage=75.0 \
-XX:+UseG1GC \
@@ -1,51 +1,58 @@
server:
port: ${MASTERDATA_SERVER_PORT:8086}
ktor:
port: ${MASTERDATA_KTOR_PORT:8091}
spring:
application:
name: masterdata-service
main:
banner-mode: "off"
datasource:
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/pg-meldestelle-db}
username: ${SPRING_DATASOURCE_USERNAME:pg-user}
password: ${SPRING_DATASOURCE_PASSWORD:pg-password}
driver-class-name: org.postgresql.Driver
flyway:
enabled: true
baseline-on-migrate: true
cloud:
consul:
host: ${SPRING_CLOUD_CONSUL_HOST:localhost}
port: ${SPRING_CLOUD_CONSUL_PORT:8500}
enabled: ${CONSUL_ENABLED:true}
discovery:
enabled: ${CONSUL_ENABLED:true}
register: ${CONSUL_ENABLED:true}
enabled: true
register: true
prefer-ip-address: true
health-check-path: /actuator/health
health-check-interval: 20s
health-check-timeout: 10s
# deregister-critical-service-after: 5m
# health-check-port: 8086 # Spring Boot Management Port (Actuator)
health-check-port: ${MASTERDATA_SERVER_PORT:8086}
instance-id: ${spring.application.name}:${server.port}:${random.uuid}
service-name: ${spring.application.name}
port: ${masterdata.http.port:8091} # Ktor API Port registrieren (Gateway Ziel)
port: ${MASTERDATA_KTOR_PORT:8091}
server:
port: 8086 # Spring Boot Management Port (Actuator & Tomcat)
address: 0.0.0.0 # Erreichbar für Consul Health Checks
#server:
# port: 8086 # Spring Boot Management Port (Actuator & Tomcat)
# address: 0.0.0.0 # Erreichbar für Consul Health Checks
masterdata:
http:
port: 8091 # Ktor API Port (Haupt-Einstiegspunkt für REST-Anfragen)
address: 0.0.0.0 # Öffentlich erreichbar innerhalb des Netzwerks / Containers
#masterdata:
# http:
# port: 8091 # Ktor API Port (Haupt-Einstiegspunkt für REST-Anfragen)
# address: 0.0.0.0 # Öffentlich erreichbar innerhalb des Netzwerks / Containers
management:
endpoints:
web:
exposure:
include: "health,info,metrics,prometheus"
include: health,info,metrics,prometheus
endpoint:
health:
show-details: always
show-components: always
probes:
enabled: true
prometheus: