I created hello world Spring Boot v2.0.0.M7 app, added actuator, enabled shutdown and it isn't working.
application.properties
server.port=8082
endpoint.shutdown.enabled=true
endpoint.shutdown.sensitive=false
health works fine
but not the shutdown
What am I doing wrong?
Use the static exit() method in the SpringApplication class for closing your spring boot application gracefully.
You can enable or disable an actuator endpoint by setting the property management. endpoint. <id>. enabled to true or false (where id is the identifier for the endpoint).
Overriding the Actuator base path - Spring Boot Tutorial Well, we do have the option of customizing a base path from actuator to something else such as manage. And to do so, we would go into our properties file and add in additional configuration to change the base path from actuator to manage.
Endpoints have changed quite a bit in Spring Boot 2.0 and, as a result, your configuration is out of date. You need to enable the endpoint and also expose it over HTTP:
management.endpoints.web.expose=*
management.endpoint.shutdown.enabled=true
As already noted in the comments, and described in the Actuator HTTP API documentation, you also need to make a POST
request so accessing the endpoint in your browser won't work. You can use something like curl
on the command line instead:
$ curl -X POST localhost:8080/actuator/shutdown
You can learn more about changes in Spring Boot 2.0 by reading the release notes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With