<https://gist.github.com/bjonnh/1be4b8b063493e90f8...
# spring
c
System.exit(0)
could be dangerous. I suggest using this instead:
SpringApplication.exit(ctx)
👍 1
b
Is there a reason here? Would the SpringApplication do things to close up services and so on?
c
Yes, this does not always matter, but sometimes there are services which need a headsup before being closed to finalize something, like flush to a log file or alike.
SpringApplication.exit
first closes the context, properly calling all the shutdown hooks, then shuts down the application.
b
Make sense!
All of what you said works perfectly. Thanks