This is a library to schedule calls with fix time rate to call the app actuator refresh
endpoint. By calling the refersh endpoint, a call will be made to the Spring config server to refresh the app properties. Note there are other ways for the spring boot app to refresh its properties, but this library offer the simplest way of achieving this.
- Add the dependency in your pom file
<dependency>
<groupId>dev.cirta</groupId>
<artifactId>springcloud-cofig-properites-refresher</artifactId>
<version>1.0.0</version>
<scope>runtime</scope>
</dependency>
- Import the refresher component through Spring Annotation.
@SpringBootApplication
@EnableScheduling
@Import({RestConfig.class, PropertyRefresher.class})
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
- Set the refresh rate of the properties in the application.yml
# in milliseconds
propertiesRefreshRate=90000000