Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Cloud Consul /refresh endpoint missing

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?

like image 574
Eugene Ugrevatov Avatar asked Mar 31 '16 15:03

Eugene Ugrevatov


People also ask

How do I enable actuator refresh endpoint?

You can invoke the refresh Actuator endpoint by sending an empty HTTP POST to the client's refresh endpoint: http://localhost:8080/actuator/refresh . Then you can confirm it worked by visting the http://localhost:8080/message endpoint.

What is RefreshScope?

The RefreshScope is a bean in the context and has a public refreshAll() method to refresh all beans in the scope by clearing the target cache. The /refresh endpoint exposes this functionality (over HTTP or JMX). To refresh an individual bean by name, there is also a refresh(String) method.

How do I bypass config server properties?

Overriding the Values of Remote Properties If you want to allow your applications to override the remote properties with their own System properties or config files, the remote property source has to grant it permission by setting spring. cloud. config. allowOverride=true (it doesn't work to set this locally).

What is the use of @RefreshScope in spring boot?

The @RefreshScope annotation is used to load the configuration properties value from the Config server. Now, add the config server URL in your application. properties file and provide your application name. Note − http://localhost:8888 config server should be run before starting the config client application.


1 Answers

You need to include the spring boot actuator

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
like image 196
spencergibb Avatar answered Oct 09 '22 13:10

spencergibb