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

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.

主站蜘蛛池模板: 荣昌县| 淳安县| 申扎县| 锡林郭勒盟| 微山县| 弥渡县| 常熟市| 自贡市| 阿图什市| 七台河市| 溆浦县| 琼结县| 江油市| 峨边| 临安市| 东兰县| 固阳县| 海林市| 彭山县| 霸州市| 南安市| 饶河县| 新乐市| 长乐市| 泸州市| 大名县| 搜索| 湖州市| 临猗县| 雷波县| 仁怀市| 东至县| 金平| 连州市| 房山区| 永城市| 镇巴县| 东莞市| 两当县| 广西| 永泰县|