I am using Spring Cloud Consul for distributed configuration with Consul and everything is going well. The entire configuration is currently and successfully read from the Consul server when the application starts. But I canβt reload this configuration for my application when some Consul data has changed because there is no /refresh endpoint. But here it says: "Sending an HTTP POST to update / reboot will reload the configuration." As far as I understand, this should be like for Spring Cloud Config Client, but it is not. What did I miss?
/refresh
You need to enable spring actuator
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
Or add @RefreshScope to your bean, e.g.
@RefreshScope
@Component @RefreshScope public class MyConsulConfig { @Value("${consul.base.url}") private String baseUrl; }
Source: https://habr.com/ru/post/1246166/More articles:How to calculate AWS V4 signature in Swagger before request - amazon-web-servicesVector padding through OpenMP streams - c ++Should kthread_stop be used if we return from the kernel thread? - cCalculate necessary equipment when changing in time intervals - pythonDoes atomic science require 0-initialization to set the value to 0? - c ++List of concepts and tuples in Julia - julia-langCocoapods and custom xcconfig - iosBot Framework always gets an unauthorized response - botframeworkVagrant Up VT-X unavailable - vagrantPHP: copying by writing and assigning by reference perform different actions in PHP5 and PHP7 - phpAll Articles