Reputation: 53
I need to gracefully start and shutdown the spring boot application using a script . Is there any other way to do it except using an actuator module in the application. Currently i have to stop the spring boot process manually in the task manager.
Upvotes: 3
Views: 10136
Reputation: 775
Ultimately the spring boot application spins off a java process which needs to be killed. At present you are killing it manually.
You have a few options:
SpringApplication.exit(ApplicationContext, ExitCodeGenerator...)
method.System.exit(0)
SpringApplication.run
gives you ApplicationContext
which you can close.Upvotes: 2