I’m a spring-boot newbie, so please go easy on me.
I need to offer a way for an administrator to start and stop my spring-boot microservice from a job scheduler. If I can create
If you have Spring Boot Actuator included in your project, you can enable a shutdown endpoint (by default it is not enabled). This means that if you make a request to: http://yourserver.com/yourapp/shutdown, the application will shutdown gracefully. An administrator could do such a request using a standard tool such as curl.
See Endpoints in the Spring Boot reference documentation. You can enable the shutdown endpoint by adding the following to your
Ofcourse, you'll want to restrict access to this endpoint, otherwise anyone who has access to the service could do a request and shutdown the application.