优雅的关闭Spring|优雅的关闭Spring Boot应用

添加Maven依赖

org.springframework.boot spring-boot-starter-actuator

配置
endpoints: shutdown: enabled: true sensitive: falsemanagement: context-path: /manage port: 8888 address: 127.0.0.1

关闭
curl -X POST localhost:8888/manage/shutdown

    推荐阅读