Spring Cloud Config Server
Spring Cloud Config Client
actuator方式刷新配置
客户端修改如下:
一、依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
二、@RefreshScope
在需要刷新的类上加@RefreshScope
三、配置文件
application.properties添加
management.endpoints.web.exposure.include=refresh
四、修改配置文件后,执行刷新接口生效
post请求:
http://localhost:8086/actuator/refresh
注:localhost:8086为客户端访问地址
G