# 关机时取消注册

程序正常关闭,以便能够拦截已停止的事件(Event)并将事件发送到服务器。

正常关闭的最佳方法是使用 Spring Actuator 的 /shutdown 端点。

需要 spring-boot-starter-actuator 依赖

配置

endpoints:
  shutdown:
    enabled: true
    sensitive: false

POST /shutdown API