对于最新稳定版本,请使用 Spring Boot 4.0.4spring-doc.cadn.net.cn

关闭(shutdown

shutdown 端点用于关闭应用程序。spring-doc.cadn.net.cn

关闭应用程序

要关闭应用程序,请向 POST 发送一个 /actuator/shutdown 请求,如下所示的基于 curl 的示例:spring-doc.cadn.net.cn

$ curl 'http://localhost:8080/actuator/shutdown' -i -X POST

将生成类似于以下内容的响应:spring-doc.cadn.net.cn

HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 41

{
  "message" : "Shutting down, bye..."
}

响应结构

响应包含关机请求结果的详细信息。 下表描述了响应的结构:spring-doc.cadn.net.cn

路径 类型 <description> </description>

messagespring-doc.cadn.net.cn

Stringspring-doc.cadn.net.cn

描述请求结果的消息。spring-doc.cadn.net.cn