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

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.

主站蜘蛛池模板: 建瓯市| 柏乡县| 云龙县| 教育| 兰坪| 临高县| 大埔区| 眉山市| 文成县| 武强县| 安阳市| 平阴县| 绍兴市| 台江县| 浦城县| 彰武县| 河东区| 阿克苏市| 商丘市| 嘉峪关市| 孟州市| 金昌市| 漳浦县| 武汉市| 丹寨县| 焉耆| 广东省| 保德县| 寻乌县| 成都市| 曲水县| 若羌县| 澜沧| 高陵县| 措美县| 湄潭县| 黔江区| 达州市| 宁陕县| 昭苏县| 洪湖市|