'Spring cloud bus not updating config property for all instances
I am using spring cloud bus with kafka to update the config property for multiple instances at once. I have a cloud-config server running on localhost:8888,
Find the below property for cloud config server :
server.port=8888
spring.application.name=clientServer
spring.cloud.config.server.default-label=master
spring.cloud.config.server.git.uri=https://github.com/kumawatanupriya/demo-cloud-config.git
management.endpoints.web.exposure.include=*
management.endpoint.env.post.enabled=true
spring.cloud.config.enabled=false
spring.cloud.bus.enabled=true
spring.cloud.stream.kafka.binder.brokers=localhost:9092
spring.cloud.stream.kafka.binder.zkNodes=localhost:2181
Find the below dependencies used for cloud config server :
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.cloud:spring-cloud-starter-bus-kafka'
implementation 'org.springframework.cloud:spring-cloud-config-server'
implementation 'org.springframework.cloud:spring-cloud-config-monitor'
I am running 3 instances of cloud-config-client on localhost:8080, 7011, 7012.
Find the below property for cloud config client :
spring.config.import=configserver:http://localhost:8888
management.endpoints.web.exposure.include=*
management.endpoint.env.post.enabled=true
spring.cloud.bus.enabled=true
spring.cloud.bus.refresh.enabled=true
spring.cloud.bus.env.enabled=true
endpoints.spring.cloud.bus.refresh.enabled=true
endpoints.spring.cloud.bus.env.enabled=true
spring.cloud.bus.trace.enabled=true
spring.cloud.stream.kafka.binder.autoAddPartitions=true
spring.cloud.stream.kafka.binder.brokers=localhost:9092
spring.cloud.stream.kafka.binder.zkNodes=localhost:2181
spring.profiles.active=test
Find the below dependencies used for config client :
implementation 'org.springframework.boot:spring-boot-starter-web'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
implementation 'org.springframework.cloud:spring-cloud-starter-bus-kafka'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'org.springframework.cloud:spring-cloud-stream'
implementation "org.springframework.cloud:spring-cloud-stream-binder-kafka"
I have a git repo with config file including property inventory.initial.mode
.
When i update this property in github and hit this bus refresh endpoint localhost:8080/actuator/busrefresh
. it only changes the value for one instances localhost:8080, it doesn't change it for 7011, 7012.
I tried hitting config-server refresh enpoint as well localhost:8888/actuator/busrefresh
, but it also didn't update the value.
I added the monitor as well in config-server still it's not updating. please help me identify the issue.
What am I doing wrong??
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|