bunsWei
2020-01-09 22:41:38
SpringCloudConfig手动刷新的坑
1、使用@RefreshScope注解
2、由于Spring boot 2.0的改动,之前查到的资料不太符合,/bus/refresh全部整合到了actuador里,需要在yml文件加如下配置:
management:
endpoints:
web:
exposure:
include: bus-refresh
3、post请求config客户端的/actuator/bus-refresh端点
http://localhost:8088/actuator/bus-refresh
再次访问http://localhost:8088/config/profile,发现配置文件为最新配置。
评论