目录
https://www.bilibili.com/video/BV18E411x7eT?p=74
P74_Config分布式配置中心介绍 10:50
P75_Config配置总控中心搭建 15:20
P76_Config客户端配置与测试 16:47
P77_Config动态刷新之手动版 12:50
P78_Bus消息总线是什么 07:55
P79_Bus之RabbitMQ环境配置 03:56
P80_Bus动态刷新全局广播的设计思想和选型 07:48
P81_Bus动态刷新全局广播配置实现 14:13
P82_Bus动态刷新定点通知 05:41

P74_Config分布式配置中心介绍
spring-cloud-config 官网
https://cloud.spring.io/spring-cloud-static/spring-cloud-config/2.2.1.RELEASE/reference/html/

P75_Config配置总控中心搭建
hosts 配置增加
127.0.0.1 config3344.com
启动eureka 注册中心
http://localhost:7001/
注意示例是 master 分支 ,我的是main 分支
注意示例是 config-3344 ,我的是 config3344
方式一
http://config3344.com:3344/main/config-dev.yml
http://config3344.com:3344/main/config-test.yml
http://config3344.com:3344/main/config-prod.yml
方式二 :
http://config3344.com:3344/config/dev/main
http://config3344.com:3344/config/test/main
http://config3344.com:3344/config/prod/main
P76_Config客户端配置与测试

P77_Config动态刷新之手动版
http://eureka7001.com:7001
http://config3344.com:3344/main/config-dev.yml
http://localhost:3355/configInfo
更改 https://github.com/wei198621/spingcloud-config/blob/main/config-dev.yml 中的内容,
http://config3344.com:3344/main/config-dev.yml
会变化
但是
http://localhost:3355/configInfo
没有变化
按照如下操作 ,
操作1 :
#暴露监控端点
management:
endpoints:
web:
exposure:
include: “*”
操作2: 3355 controller 上面增加
@RefreshScope
操作3:
curl -X POST “http://localhost:3355/actuator/refresh”

不用重启,再次执行 ,
http://localhost:3355/configInfo
有变化了,
P78_Bus消息总线是什么
P79_Bus之RabbitMQ环境配置
https://www.erlang.org/downloads
https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.3/rabbitmq-server-3.8.3.exe
rabbitmq-plugins enable rabbitmq_management

http://localhost:15672
输入账号并登录 guest guest

P80_Bus动态刷新全局广播的设计思想和选型 

P81_Bus动态刷新全局广播配置实现


http://eureka7001.com:7001
http://config3344.com:3344/main/config-dev.yml
http://localhost:3355/configInfo
http://localhost:3366/configInfo
修改 https://github.com/wei198621/spingcloud-config/blob/main/config-dev.yml 中的配置文件内容,再次查看上面的数据
发现 3344修改了 3355 3366 没有修改
当执行下面的更新后
curl -X POST “http://localhost:3344/actuator/bus-refresh”
再次 查看
http://localhost:3355/configInfo
http://localhost:3366/configInfo
已经修改
http://localhost:15672/

P82_Bus动态刷新定点通知
执行下面语句后 3355 跟着3344变了 3366 没有变
curl -X POST “http://localhost:3344/actuator/bus-refresh/config-client:3355”


本文详细介绍Spring Cloud Config分布式配置中心的搭建及使用方法,并探讨Bus消息总线原理与配置实现,包括RabbitMQ环境配置和动态刷新机制。
5917

被折叠的 条评论
为什么被折叠?



