程序正常关闭,以便能够拦截已停止的事件(Event)并将事件发送到服务器。
正常关闭的最佳方法是使用 Spring Actuator 的 /shutdown 端点。
/shutdown
需要 spring-boot-starter-actuator 依赖
spring-boot-starter-actuator
配置
endpoints: shutdown: enabled: true sensitive: false
POST /shutdown API
POST /shutdown
← 密码保护 Self-Preservation →