spring boot 优雅的关闭服务
实现ContextClosedEvent 监听器,监听到关闭事件后,关闭springboot进程
**
网上有很多例子 使用spring boot 插件做关闭经测试此插件只能是关闭spring boot服务,不能杀死服务进程。还是需要实现关闭监听,去杀死进程。
网上有很多例子 使用spring boot 插件做关闭经测试此插件只能是关闭spring boot服务,不能杀死服务进程。还是需要实现关闭监听,去杀死进程。
网上有很多例子 使用spring boot 插件做关闭经测试此插件只能是关闭spring boot服务,不能杀死服务进程。还是需要实现关闭监听,去杀死进程。
重要的事说三遍
**
actuator 关闭spring boot 实现方式
引入actuator 配置 shutdown
调用http://127.0.0.1/xxx/
引入actuator
<dependency>
<groupId>org.springframework.boot