1.首先需注意,springcloud2021新版中bus-refresh接口改为busrefresh;
2.其次在刷新前需要在server端的yml文件中暴露接口:
management:
endpoints:
web:
exposure:
include: "*"
3.接着访问/actuator/busrefresh,如果提示:
"status": 405,
"error": "Method Not Allowed",
"message": "Request method 'POST' not supported",
"path": "/actuator/bus-refresh"
4.则需要在server端的pom文件中引入依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
5.至此,client端配置可以正常刷新;