代码链接:https://pan.baidu.com/s/1m556IsWY-mTavPsDMkIubQ
提取码:t8we
一、码云上创建配置文件仓库
二、配置文件并验证
1、配置中心服务端调用码云文件
地址:http://localhost:8066/order-config-dev.properties
2、客户端调用配置中心的配置文件信息
地址:http://localhost:7000/getOrder
3、监控中心手动刷新
3.1添加pom.xml配置
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
3.2开启客户端的端点监控
3.3重新启动,改动码云的配置文件,调用POST方式的actuator/refresh方法,客户端配置文件则可刷新
地址:http://localhost:7000/actuator/refresh
可使用PostMan工具