Compare commits

...
2 Commits
Author SHA1 Message Date
2martens 323337ed64 Added quotes around bootstrap server property
continuous-integration/drone/tag Build is passing
2023-10-30 00:32:19 +01:00
2martens b04d6f4389 Added support for passing ports in via environment variables 2023-10-29 18:07:50 +01:00
4 changed files with 3 additions and 27 deletions
@@ -1,20 +0,0 @@
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)
}
}
@@ -1,7 +1,3 @@
server.port: 12000
management.server.port: 12001
spring: spring:
config: config:
import: import:
@@ -4,4 +4,4 @@ spring:
- "configserver:${CONFIGSERVER_SCHEME:http}://${CONFIGSERVER_HOST:configserver}:${CONFIGSERVER_PORT:8888}${CONFIGSERVER_PREFIX:/config}" - "configserver:${CONFIGSERVER_SCHEME:http}://${CONFIGSERVER_HOST:configserver}:${CONFIGSERVER_PORT:8888}${CONFIGSERVER_PREFIX:/config}"
kafka: kafka:
bootstrap-servers: bootstrap-servers:
- ${KAFKA_HOST:kafka}:${KAFKA_PORT:9092} - "${KAFKA_HOST:kafka}:${KAFKA_PORT:9092}"
@@ -1,12 +1,12 @@
server: server:
port: 12000 port: ${PORT:12000}
shutdown: graceful shutdown: graceful
forward-headers-strategy: framework forward-headers-strategy: framework
### technical configurations ### ### technical configurations ###
management: management:
# for security, don't use same port as application # for security, don't use same port as application
server.port: 12001 server.port: ${ACTUATOR_PORT:12001}
health: health:
livenessState.enabled: true livenessState.enabled: true
readinessState.enabled: true readinessState.enabled: true