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打印出的日志。

猜你喜欢

转载自www.cnblogs.com/Little-tree/p/9168033.html