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

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.

主站蜘蛛池模板: 乳山市| 长治市| 湾仔区| 抚顺县| 游戏| 邵东县| 蒲城县| 上蔡县| 太保市| 临海市| 谷城县| 红原县| 尉犁县| 五河县| 通江县| 盐池县| 新宾| 大同市| 吉首市| 定边县| 武山县| 湖州市| 无为县| 丹棱县| 大荔县| 新宁县| 安庆市| 英吉沙县| 岳西县| 奉化市| 吉林省| 上饶市| 临江市| 沧州市| 且末县| 中山市| 崇礼县| 双峰县| 海伦市| 徐闻县| 时尚|