can we use spring cloud config to change the configuration properties of one of the beans at runtime without having to restart the application i.e requiring context reloading.
I currently have a spring boot setup where any change to the application properties needs a restart of the application.
CodePudding user response:
There are multiple options for refreshing the config properties without restart with spring cloud config. You can:
- call the refresh endpoint if you are using the spring actuators. Remember to consider the
@RefreshScope
for beans dependent on certain properties. See https://spring.io/guides/gs/centralized-configuration/ - use Spring Cloud Config Bus as a means of broadcasting config changes to all config clients. https://spring.io/projects/spring-cloud-bus#learn