bunsWei的gravatar头像
bunsWei 2020-01-09 22:41:38
SpringCloudConfig手动刷新的坑

  1、使用@RefreshScope注解

SpringCloudConfig手动刷新的坑

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,发现配置文件为最新配置。


打赏
最近浏览
何先生 2020年9月24日
暂无贡献等级
bunsWei  LV2 2020年1月12日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友