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

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.

主站蜘蛛池模板: 临高县| 乌兰察布市| 周宁县| 荥经县| 察隅县| 东阿县| 日喀则市| 武鸣县| 盐城市| 乌拉特中旗| 哈巴河县| 米泉市| 岑溪市| 叶城县| 安溪县| 中西区| 乌拉特后旗| 铜鼓县| 昭觉县| 大港区| 云和县| 宜良县| 隆尧县| 塘沽区| 沁阳市| 浦县| 永川市| 南郑县| 丹棱县| 西充县| 华池县| 怀来县| 塘沽区| 剑川县| 铜川市| 名山县| 确山县| 资溪县| 家居| 曲沃县| 龙胜|