Added support for passing ports in via environment variables
This commit is contained in:
-20
@@ -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:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user