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

This commit is contained in:
Jim Martens 2023-10-29 01:07:02 +02:00
parent f089d70d5f
commit 517f2b4f1b
3 changed files with 20 additions and 26 deletions

View File

@ -1,20 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="MainApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
<module name="wahlrecht.server.main" />
<option name="SPRING_BOOT_MAIN_CLASS" value="de.twomartens.wahlrecht.MainApplication" />
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="true" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
<ENTRY IS_ENABLED="true" PARSER="env" IS_EXECUTABLE="false" PATH=".env" />
</ENTRIES>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>

View File

@ -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)
}
}

View File

@ -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}