Fixed kafka errors
continuous-integration/drone/tag Build is passing

This commit is contained in:
2023-10-29 01:07:02 +02:00
parent f089d70d5f
commit 517f2b4f1b
3 changed files with 20 additions and 26 deletions
@@ -0,0 +1,20 @@
package de.twomartens.wahlrecht.configuration
import org.apache.kafka.clients.admin.AdminClientConfig
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.kafka.core.KafkaAdmin
@Configuration
open class KafkaConfiguration {
@Value(value = "\${spring.kafka.bootstrap-servers[0]}")
private val bootstrapServers: List<String> = mutableListOf()
@Bean
open fun kafkaAdmin(): KafkaAdmin {
val configs: MutableMap<String, Any?> = HashMap()
configs[AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG] = bootstrapServers.first()
return KafkaAdmin(configs)
}
}
@@ -3,11 +3,5 @@ spring:
import:
- "configserver:${CONFIGSERVER_SCHEME:http}://${CONFIGSERVER_HOST:configserver}:${CONFIGSERVER_PORT:8888}${CONFIGSERVER_PREFIX:/config}"
kafka:
producer:
bootstrap-servers:
- ${KAFKA_HOST:kafka}:${KAFKA_PORT:9092}
consumer:
bootstrap-servers:
- ${KAFKA_HOST:kafka}:${KAFKA_PORT:9092}
bootstrap-servers:
- ${KAFKA_HOST:kafka}:${KAFKA_PORT:9092}