1. springcloud1.5.x的消息总线配置是

# RabbitMq的地址、端口,用户名、密码
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
# 保证调用 /bus/refresh的时候不需要验证
management.security.enabled=false

configServer的启动类加上注解@RefreshScope

configClient的启动类也加上注解@RefreshScope

修改github上的配置文件之后,打开postman,请求方式是post,地址是http://localhost:8881/bus/refresh,这个端口号是configServer的。

请求成功之后,返回的是空白,此时configClient就能获取到最新的配置信息。

2.  springcloud2.x的消息总线配置是

# RabbitMq的地址、端口,用户名、密码
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest # 刷新配置,在spring boot 2.x 之前1.x的management.security.enabled失效,新的配置为
management.endpoints.web.exposure.include=bus-refresh

configServer的启动类加上注解@RefreshScope

configClient的启动类也加上注解@RefreshScope

修改github上的配置文件之后,打开postman,请求方式是post,地址是http://localhost:8881/actuator/bus-refresh,这个端口号是configServer的。

请求成功之后,返回的是空白,此时configClient就能获取到最新的配置信息。

3. 需要注意的是configClient也要配置RabbiMq。

最新文章

  1. MongoDB replica set IDs do not match
  2. 电脑缺少**.dll文件
  3. Linq对XML的简单操作
  4. VS2010开发AutoCAD 2012 .net应用程序调试时断点不起作用
  5. LR手动关联新手总结
  6. git乱码问题解决
  7. linux 重新编译低版本gcc
  8. (转)一个JavaWeb项目开发总结
  9. 配置错误定义了重复的“system.web.extensions/scripting/scriptResourceHandler” 解决办法
  10. Maven的HTTP代理设置
  11. php集成开发环境的安装以及Zend Studio开发工具的安装
  12. Mishka and Interesting sum
  13. Linux系统上安装JDK1.8
  14. c#中@标志的作用
  15. jexus独立版设置支持https
  16. javascript 使用数组+循环+条件实现数字转换为汉字的简单方法。
  17. SQLite可视化工具SQLite studio
  18. 【转载】如何将本地文件上传到github托管
  19. C. Sequence Transformation
  20. Selenium基础知识(四)表单切换

热门文章

  1. MongoDB官方下载安装设置配置文件指定端口号
  2. 微服务通过feign.RequestInterceptor传递参数
  3. RSA加密方法
  4. electron——ipcMain模块、ipcRenderer模块
  5. 微信小程序 自定义头部导航栏和导航栏背景图片 navigationStyle
  6. 新手入门必看:VectorDraw 常见问题整理大全(二)
  7. Linux open fopen fdopen
  8. 高性能TcpServer(C#) - 5.客户端管理
  9. 当MySQL数据库遇到Syn Flooding
  10. odoo10学习笔记七:国际化、报表