官术网_书友最值得收藏!

Shutting down your application

You can also shut down your application by using the /shutdown endpoint. But by default, this endpoint is disabled, so first, you have to enable the /shutdown endpoint, and then you can use it as follows:

endpoints.shutdown.enabled=true

Let's enable it by using the application.yml file:

endpoints:
   shutdown:
         enabled: true 

Let's invoke the /shutdown endpoint and see what happens:

POST http://localhost:8080/shutdown

The preceding is a POST request. It returns the following response:

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

This /shutdown endpoint can kill your application, so you have to take care with this endpoint.

Spring Boot's Actuator provides most of the insight you require concerning your running application in production, but sometimes it is not enough for your needs. That is why Spring Boot also allows you to customize the Actuator endpoints.

Let's see in the next section how to customize the endpoints of Spring Boot's Actuator.

主站蜘蛛池模板: 庆阳市| 马龙县| 册亨县| 安顺市| 图木舒克市| 九江县| 垫江县| 定边县| 平利县| 泰安市| 监利县| 揭东县| 鹿邑县| 达拉特旗| 金平| 清丰县| 图们市| 永年县| 洛宁县| 沙坪坝区| 义马市| 玉门市| 长治市| 缙云县| 阿克苏市| 渭南市| 南乐县| 井研县| 龙泉市| 莆田市| 香格里拉县| 驻马店市| 木里| 弥勒县| 西青区| 宜章县| 乐至县| 泾源县| 澳门| 阿拉善右旗| 博爱县|