fix appProps in events-server-web

This commit is contained in:
Adam 2022-10-08 14:20:01 +02:00
parent 4b921666a5
commit b0722487a0
2 changed files with 14 additions and 6 deletions

View file

@ -13,8 +13,9 @@ import org.apache.kafka.clients.producer.ProducerConfig
import org.apache.kafka.streams.StreamsBuilder
import org.apache.kafka.streams.StreamsConfig
internal val appProps = ApplicationProperties.load()
suspend fun main(): Unit = coroutineScope {
val appProps = ApplicationProperties.load()
val wsServer = WebmapWebsocketServer()
launch {
@ -45,10 +46,13 @@ private suspend fun websocketBroadcaster(wsServer: WebmapWebsocketServer) {
val topology = builder.build()
launchTopology(
"websocketBroadcaster", topology, mapOf(
id = "websocketBroadcaster",
topology = topology,
additionalProperties = mapOf(
StreamsConfig.COMMIT_INTERVAL_MS_CONFIG to "${1.seconds.inWholeMilliseconds}",
StreamsConfig.producerPrefix(ProducerConfig.LINGER_MS_CONFIG) to "${1.milliseconds.inWholeMilliseconds}"
)
StreamsConfig.producerPrefix(ProducerConfig.LINGER_MS_CONFIG) to "${1.milliseconds.inWholeMilliseconds}",
),
appProps = appProps,
)
}
@ -57,5 +61,9 @@ private suspend fun saveTiles(
) {
val builder = StreamsBuilder()
saveMapTiles(builder, appProps.serverDataDir)
launchTopology("saveTiles", builder.build())
launchTopology(
id = "saveTiles",
topology = builder.build(),
appProps = appProps
)
}