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

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.

主站蜘蛛池模板: 郓城县| 麦盖提县| 喀喇| 潍坊市| 洪湖市| 桦川县| 台湾省| 蚌埠市| 阿克| 自治县| 揭阳市| 建平县| 六枝特区| 牙克石市| 旬邑县| 乌拉特前旗| 兰西县| 湘潭市| 贵南县| 鄯善县| 黄大仙区| 大安市| 略阳县| 花莲市| 秀山| 镇江市| 汾阳市| 科技| 迁西县| 喀什市| 民权县| 嵊泗县| 嘉兴市| 榆树市| 芒康县| 乡城县| 蓬莱市| 隆子县| 松溪县| 阳高县| 桓仁|