Spring Cloud 2-Bus 消息总线(九)


Spring Cloud  Bus 

 

  • 1.服务端配置
    • pom.xml
    • application.yml
  • 2.客户端配置
    • pom.xml
    • application.yml
    • Controller.java
  • 3.自动刷新配置

 

 


服务架构

 

在分布式配置中,客户端获取远程最新配置时(比如:Git),要手动发送POST请求客户端来刷新.在集群环境下,不是很方便.使用Spring Cloud Bus总线可以自动刷新客户端配置.

http://localhost:8888/actuator/bus-refresh
所有客户端的配置都已经更新.