[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recommendation/Best Practice for shutting down Camel Spring Boot App

even though your app is not a web app, adding "web" and actuator add value
for things like metrics and health status .... and things like this. Why
not just add those two items? That is what i do.

And fyi,  you might ask this on the spring forums as this really is a
Spring Boot question.

On Wed, Apr 4, 2018 at 4:20 PM, Jonathan Cook <jonathan.cook@xxxxxxxxxxxxxx>

> Hello,
> I was wondering if there was a way to shutdown a camel application which
> uses Spring Boot in a graceful way? I've seen this page -
> http://camel.apache.org/graceful-shutdown.html but it doesn't really
> explain it. For example I have a shell script for starting the app which
> runs my standalone java app.
> To shut it down I was thinking of another shell script but don't simply
> want to kill the process. I've see Spring Boot Actuator provides a way via
> http but my app is not a webapp in a fat jar, just a standalone java app.
> I've also seen Spring Boot has a ApplicationPidFileWriter which writes the
> pid to a file but again this approach uses a brute force kill.
> There seems to be a couple of tests here related to it:
> https://github.com/apache/camel/tree/master/components/camel
> -spring-boot/src/test/java/org/apache/camel/spring/boot
> But it isn't clear, do I have to create some kind of custom shutdown hook
> which I can call externally and stop the camel context or shut the routes
> down gracefully or does something in Camel Spring Boot do this for me?
> Thanks for any help