akhettar / springcloud-config-property-refresher

Spring Cloud Config Referesher

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring Cloud Properties Refresher

Overview

Config server

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.

How to include this library in your SpringBoot app?

  1. 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>
  1. 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);
    }
}
  1. Set the refresh rate of the properties in the application.yml
# in milliseconds
propertiesRefreshRate=90000000

About

Spring Cloud Config Referesher

License:MIT License


Languages

Language:Java 100.0%