You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by raffi <ra...@gmail.com> on 2015/12/10 20:25:16 UTC

Shutdown sequence when running Camel in Springboot

With respect to graceful shutdown, does Springboot hook into Camel such that
invoking Springboot's standard "/shutdown" endpoint automatically shuts down
Camel first, then the JVM?

Trying to understand if explicit shutdown hooks are requried. 

Best
Raffi



--
View this message in context: http://camel.465427.n5.nabble.com/Shutdown-sequence-when-running-Camel-in-Springboot-tp5774960.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Shutdown sequence when running Camel in Springboot

Posted by raffi <ra...@gmail.com>.
Nevermind, figured it out from this article:

http://www.javacodegeeks.com/2014/10/spring-boot-actuator-custom-endpoint-with-mvc-layer-on-top-of-it.html





--
View this message in context: http://camel.465427.n5.nabble.com/Shutdown-sequence-when-running-Camel-in-Springboot-tp5774960p5774974.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Shutdown sequence when running Camel in Springboot

Posted by raffi <ra...@gmail.com>.
Yeah, I see that working now, just POST to "/shutdown" and springboot shuts
everything down, including Camel.

The problem with SB's shutdown endpoint is, although it stops Camel first,
then the JVM, the initial request to `/shutdown` returns immediately, but
the time between the request and when the JVM terminates can take up to 60s,
sometimes more, and that's a problem for our deployment scripts. But if I
shutdown Camel from JMX, then shutdown SB from "/shutdown", it's much more
predictable.

I want to override Springboot's shutdown process with custom code to
shutdown Camel manually from JMX. Doing so blocks until Camel is shutdown,
and that's what I'm after, except I can't figure out how to override
Springboot's shutdown sequence.   



--
View this message in context: http://camel.465427.n5.nabble.com/Shutdown-sequence-when-running-Camel-in-Springboot-tp5774960p5774968.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Shutdown sequence when running Camel in Springboot

Posted by Henryk Konsek <he...@gmail.com>.
Yes. CamelContext is wired as a Spring bean with registered shutdown
method, so calling Spring's shutdown will close CamelContext in the first
place before closing Spring context.

Cheers!

czw., 10.12.2015 o 20:25 użytkownik raffi <ra...@gmail.com> napisał:

> With respect to graceful shutdown, does Springboot hook into Camel such
> that
> invoking Springboot's standard "/shutdown" endpoint automatically shuts
> down
> Camel first, then the JVM?
>
> Trying to understand if explicit shutdown hooks are requried.
>
> Best
> Raffi
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Shutdown-sequence-when-running-Camel-in-Springboot-tp5774960.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
-- 
Henryk Konsek
http://about.me/hekonsek