代碼鏈接: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工具