spring boot 2.0.1.RELEASE版本之消息总线 ConfigClient配置自动刷新

参考博文https://blog.csdn.net/qq_35098526/article/details/80017725

关键:

1、 @RefreshScope 注解在@Value所在的类,不注解不会刷新。

2、适用于2.0的配置application.yml

 management:

  endpoints:

    web:

      exposure:

        include: bus-refresh

 

3、请求http://localhost:${config-client-port}/actuator/bus-refresh(使用post方法)

注意查看config-client打印出的日志。

posted @ 2018-06-11 17:12  lion1  阅读(154)  评论(0编辑  收藏  举报