优雅的关闭Spring Boot应用

添加Maven依赖

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

配置

endpoints:
  shutdown:
    enabled: true
    sensitive: false

management:
  context-path: /manage
  port: 8888
  address: 127.0.0.1

关闭

curl -X POST localhost:8888/manage/shutdown

你可能感兴趣的:(优雅的关闭Spring Boot应用)