在客戶端添加如下配置
pom依賴 actuator.jar包
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
或者
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
application.yml全局配置文件添加如下
management: endpoints: web: exposure: include: shutdown #暴漏shutdown端點服務 endpoint: shutdown: enabled: true
然后在postman里邊用post請求方式,請求如下地址
http://ip:port/actuator/shutdown
官方介紹:
https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html