问题:在运维人员修改外部配置文件后(githun远程库config中的配置文件),config服务端能随之变化而变化,而config客户端并不会刷新?
目的:避免服务重启
1、在bootstrap.yml配置文件添加
–bootstrap.yml优先级高于application.yml
2、在controller业务类中添加注解 @RefreshScope
3、通过curl发送一个POST请求
curl -X POST “http://localhost:3355/actuator/refresh”
测试通过即可
springcloud-config配置中心实现动态刷新-手动版
最新推荐文章于 2023-06-30 10:46:48 发布