关闭 (shutdown)
原文:https://docs.spring.io/spring-boot/api/rest/actuator/shutdown.html
shutdown 端点用于关闭应用。
关闭应用
向 /actuator/shutdown 发出 POST 请求:
$ curl 'http://localhost:8080/actuator/shutdown' -i -X POST
响应类似如下:
HTTP/1.1 200 OK Content-Type: application/vnd.spring-boot.actuator.v3+json { "message" : "Shutting down, bye..." }
端点默认禁用,需要通过 management.endpoint.shutdown.enabled=true 启用,并且应仅在受保护的环境中使用。