Resolve port conflicts in masterdata-service: update application.yml with separated bind addresses (Spring: 127.0.0.1, Ktor: 0.0.0.0), change management port to 8086, and add explicit datasource and Flyway configuration. Fix startup issues with Database.connect() in MasterdataDatabaseConfiguration.
This commit is contained in:
parent
aa9e2da3a3
commit
933ef9cd6c
|
|
@ -23,6 +23,8 @@ Versionierung folgt [Semantic Versioning](https://semver.org/lang/de/).
|
|||
- **Infrastructure:** `ZnsImportService` vollständig auf die neuen spezialisierten Parser umgestellt und als Spring-Bean im Backend registriert.
|
||||
- **QA:** Umfassende Test-Suite `ZnsParserTest.kt` mit realen ZNS-Daten (Hämmerle, Neuwirth, etc.) erstellt; Korrektur der Extraktions-Logik für Mitgliedsnummern (Position 147) und Funktionär-Daten (RICHT01).
|
||||
- **QA:** Neue Betriebsanleitung für ZNS-Importer Tests erstellt: `docs/07_Infrastructure/runbooks/ZNS_Importer_Test_Manual.md`.
|
||||
- **Infrastructure:** `MasterdataDatabaseConfiguration` korrigiert: Expliziter Aufruf von `Database.connect()` hinzugefügt, um Abstürze beim Anwendungsstart ("No database specified") zu beheben.
|
||||
- **Infrastructure:** `application.yml` im `masterdata-service` vervollständigt (DataSource-Konfiguration mit `pg-user`/`pg-password` und Flyway-Aktivierung).
|
||||
- **Domain:** Legacy-Spezifikationen für ZNS-Schnittstellen (Import/Export) formalisiert:
|
||||
- `docs/03_Domain/02_Reference/Legacy_Specs/OETO-2026_Meldestelle_Pflichtenheft_V2.4.md` (Basis-Satzarten A-N)
|
||||
- `docs/03_Domain/02_Reference/Legacy_Specs/OETO-2026_Meldestelle_Erweiterung-Schnittstelle_2014.md` (XML-Erweiterung, LinkID-Logik)
|
||||
|
|
@ -34,6 +36,8 @@ Versionierung folgt [Semantic Versioning](https://semver.org/lang/de/).
|
|||
|
||||
### Behoben
|
||||
|
||||
- **Infrastructure:** Start-Probleme des `masterdata-service` endgültig behoben: Port-Konflikt zwischen Spring Boot (Management/Actuator) und dem Gateway (8081) durch Umzug auf Port 8086 (gemäß Infrastruktur-Vorgaben) gelöst.
|
||||
- **Infrastructure:** Port-Konflikt im `masterdata-service` durch Trennung der Bind-Adressen (Spring: 127.0.0.1, Ktor: 0.0.0.0) und Bereinigung verwaister Prozesse stabilisiert.
|
||||
- **Core:** Veraltete `ZnsLegacyParsersTest.kt` entfernt; alle Tests sind nun in `ZnsParserTest.kt` konsolidiert.
|
||||
- **Domain:** Fehlschlagenden `LicenseMatrixServiceTest` behoben; fehlende `reiterLizenz`-Daten in Test-Reitern ergänzt und Fallback-Logik in `LicenseMatrixServiceImpl` für spartenübergreifende Lizenzen (z.B. Springlizenz für Dressur-Basis) stabilisiert.
|
||||
- **Infrastructure:** Fehlschlagenden `RegulationSeedVerificationTest` behoben; Testdaten an das neue Modell (`reiterLizenz` Feld) angepasst.
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ class KtorServerConfiguration {
|
|||
@Bean
|
||||
fun ktorServer(
|
||||
@Value("\${masterdata.http.port:8091}") port: Int,
|
||||
@Value("\${masterdata.http.address:0.0.0.0}") host: String,
|
||||
meterRegistry: MeterRegistry,
|
||||
countryController: CountryController,
|
||||
bundeslandController: BundeslandController,
|
||||
|
|
@ -37,8 +38,8 @@ class KtorServerConfiguration {
|
|||
funktionaerController: FunktionaerController,
|
||||
regulationController: RegulationController
|
||||
): EmbeddedServer<NettyApplicationEngine, NettyApplicationEngine.Configuration> {
|
||||
log.info("Starting Masterdata Ktor server on port {}", port)
|
||||
val engine = embeddedServer(Netty, port = port) {
|
||||
log.info("Starting Masterdata Ktor server on {}:{}", host, port)
|
||||
val engine = embeddedServer(Netty, port = port, host = host) {
|
||||
masterdataApiModule(
|
||||
countryController = countryController,
|
||||
bundeslandController = bundeslandController,
|
||||
|
|
|
|||
|
|
@ -8,9 +8,11 @@ import at.mocode.masterdata.infrastructure.persistence.reiter.ReiterTable
|
|||
import at.mocode.masterdata.infrastructure.persistence.verein.VereinTable
|
||||
import jakarta.annotation.PostConstruct
|
||||
import jakarta.annotation.PreDestroy
|
||||
import org.jetbrains.exposed.v1.jdbc.Database
|
||||
import org.jetbrains.exposed.v1.jdbc.SchemaUtils
|
||||
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.context.annotation.Profile
|
||||
|
||||
|
|
@ -22,7 +24,11 @@ import org.springframework.context.annotation.Profile
|
|||
*/
|
||||
@Configuration
|
||||
@Profile("!test")
|
||||
class MasterdataDatabaseConfiguration {
|
||||
class MasterdataDatabaseConfiguration(
|
||||
@Value("\${spring.datasource.url}") private val jdbcUrl: String,
|
||||
@Value("\${spring.datasource.username}") private val username: String,
|
||||
@Value("\${spring.datasource.password}") private val password: String
|
||||
) {
|
||||
|
||||
private val log = LoggerFactory.getLogger(MasterdataDatabaseConfiguration::class.java)
|
||||
|
||||
|
|
@ -31,6 +37,7 @@ class MasterdataDatabaseConfiguration {
|
|||
log.info("Initializing database schema for Masterdata Service...")
|
||||
|
||||
try {
|
||||
Database.connect(jdbcUrl, user = username, password = password)
|
||||
// Spring Boot should initialize database connection
|
||||
transaction {
|
||||
SchemaUtils.create(
|
||||
|
|
|
|||
|
|
@ -3,13 +3,23 @@ spring:
|
|||
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
|
||||
|
||||
server:
|
||||
port: 8081 # Spring Boot Management Port (Actuator)
|
||||
port: 8086 # Spring Boot Management Port (Actuator & Tomcat)
|
||||
address: 127.0.0.1 # Sicherheit: Nur lokal erreichbar
|
||||
|
||||
masterdata:
|
||||
http:
|
||||
port: 8091 # Ktor API Port
|
||||
port: 8091 # Ktor API Port (Haupt-Einstiegspunkt für REST-Anfragen)
|
||||
address: 0.0.0.0 # Öffentlich erreichbar innerhalb des Netzwerks / Containers
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
|
|
|
|||
|
|
@ -106,9 +106,8 @@ und über definierte Schnittstellen kommunizieren.
|
|||
|
||||
#### 🧐 Agent: QA Specialist
|
||||
|
||||
* [x] **Technical Debt:** Idempotency-Plugin in `masterdata` wurde stabilisiert.
|
||||
→ Fix: Unit-Test `IdempotencyPluginTest` ist wieder GRÜN. In-Flight Handling mit Timeouts und korrekter
|
||||
Pipeline-Phase (`Render`) gefixt.
|
||||
* [x] **Service Stability:** Port-Konflikt des `masterdata-service` (Spring Management Port 8081 vs. Gateway) durch Umzug auf Port 8086 und explizite Bind-Adressen (Spring: 127.0.0.1, Ktor: 0.0.0.0) dauerhaft gelöst.
|
||||
* [x] **Documentation:** `CHANGELOG.md` aktualisiert und Port-Konfiguration in `application.yml` dokumentiert.
|
||||
→ Note: `IdempotencyApiIntegrationTest` bleibt vorerst @Disabled, da das Hochfahren des Spring-Contexts in der
|
||||
Testumgebung blockiert (unabhängig vom Plugin).
|
||||
→ Task: Integration-Test Umgebung (Port-Binding/Server-Lifecycle) für `masterdata-service` untersuchen.
|
||||
|
|
|
|||
|
|
@ -14,4 +14,8 @@ Die Aufgabe des ZNS-Importer ist die vom OEPS zur Verfügung gestellten Daten
|
|||
Welche Daten und in welcher Form die ZNS-Daten vom Verband zur Verfügung gestellt werden, ist im Pflichtenheft genau Dokumentiert
|
||||
|
||||
|
||||
"jobId":"f028e1bb-fdaa-46c7-bbef-36bcdc4bb354"}st
|
||||
curl http://localhost:8081/api/v1/import/zns/{f028e1bb-fdaa-46c7-bbef-36bcdc4bb354}/status
|
||||
{"jobId":"b589e1ed-7ed5-4b6a-b884-d1a5d8d6e6e9"}
|
||||
|
||||
{"jobId":"03ad288b-ef2c-4510-ad04-9e8154a62ed1"}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user