5
votes

I'm using Spring Cloud Consul for Distributed Configuration with Consul and all goes fine. All configuration is currently and successfully read from Consul server on startup of the application. But I can't reload this configuration for my app when some data on Consul changed because there is not /refresh endpoint. But here says "Sending a HTTP POST to /refresh will cause the configuration to be reloaded." As I understand it should be like for Spring Cloud Config Client but it doesn't. What did I miss?

2

2 Answers

7
votes

You need to include the spring boot actuator

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
0
votes

Or add @RefreshScope on your bean for e.g.

@Component
@RefreshScope
public class MyConsulConfig  {

@Value("${consul.base.url}")
private String baseUrl;
}