Introduce Ktor-based HTTP server for Masterdata context, implement upsert logic for Altersklasse, Bundesland, and Land repositories, enhance IdempotencyPlugin, and add integration tests.
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Has been cancelled
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Has been cancelled
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Has been cancelled
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Has been cancelled

This commit is contained in:
2026-03-29 00:05:14 +01:00
parent eedce74a85
commit 8c2a82403e
21 changed files with 919 additions and 124 deletions
@@ -0,0 +1,50 @@
package at.mocode.masterdata.service.config
import at.mocode.masterdata.api.masterdataApiModule
import at.mocode.masterdata.api.rest.AltersklasseController
import at.mocode.masterdata.api.rest.BundeslandController
import at.mocode.masterdata.api.rest.CountryController
import at.mocode.masterdata.api.rest.PlatzController
import io.ktor.server.engine.embeddedServer
import io.ktor.server.engine.EmbeddedServer
import io.ktor.server.netty.Netty
import io.ktor.server.netty.NettyApplicationEngine
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.DisposableBean
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
/**
* Ktor-Server Bootstrap für den Masterdata-Bounded-Context (SCS-Architektur).
*
* - Startet einen eigenen Ktor Netty Server für diesen Kontext.
* - Hängt das masterdataApiModule mit den via Spring bereitgestellten Controllern ein.
* - Port ist konfigurierbar über SPRING-Config/ENV (Default 8091). Für Tests kann Port 0 genutzt werden.
*/
@Configuration
class KtorServerConfiguration {
private val log = LoggerFactory.getLogger(KtorServerConfiguration::class.java)
@Bean(destroyMethod = "stop")
fun ktorServer(
@Value("\${masterdata.http.port:8091}") port: Int,
countryController: CountryController,
bundeslandController: BundeslandController,
altersklasseController: AltersklasseController,
platzController: PlatzController
): EmbeddedServer<NettyApplicationEngine, NettyApplicationEngine.Configuration> {
log.info("Starting Masterdata Ktor server on port {}", port)
val engine = embeddedServer(Netty, port = port) {
masterdataApiModule(
countryController = countryController,
bundeslandController = bundeslandController,
altersklasseController = altersklasseController,
platzController = platzController
)
}
engine.start(wait = false)
return engine
}
}