You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by David Hoffer <dh...@gmail.com> on 2016/02/26 20:55:51 UTC

Can't shut down due to inflight and pending exchanges

For some reason we are getting the following message from
the DefaultShutdownStrategy "Waiting as there are still 1 inflight and
pending exchanges to complete, timeout in 300 seconds."

Which causes our app to not shut down for 5 minutes.  This is happening
although there was no work for the app to do.  E.g. we run as a service,
have lots of routes doing file and sftp work but in this case the app
starts no work to process but it gives this message on service shutdown.
 (Happens also when there was work to do.)

What might be this 1 exchange that is processing?  How can I determine what
it is?  Can I change the shut down strategy to cancel what might be
occurring?

-Dave

Re: Can't shut down due to inflight and pending exchanges

Posted by David Hoffer <dh...@gmail.com>.
How do I inject the defaultShutdownStrategy bean into the camelContext?

On Fri, Feb 26, 2016 at 1:20 PM, David Hoffer <dh...@gmail.com> wrote:

> I found a doc that says I can add the following to my camel context.  I
> tried it and it worked but then took it out and it still works so this
> problem is random it doesn't happen all the time, no idea what is
> triggering it yet.
>
> shutdownRoute="Default" shutdownRunningTask="CompleteCurrentTaskOnly"
>
> No we aren't using camel-disruptor, I'm not even aware of that.  Thanks
> for the bean DefaultShutdownStrategy tip, I'll experiment with that too.
>
> -Dave
>
>
>
> On Fri, Feb 26, 2016 at 1:02 PM, Matt Sicker <bo...@gmail.com> wrote:
>
>> Are you using camel-disruptor? I had a lot of problems like that.
>>
>> You could also configure your own DefaultShutdownStrategy and set a
>> smaller
>> timeout. For example:
>>
>> <bean id="defaultShutdownStrategy"
>> class="org.apache.camel.impl.DefaultShutdownStrategy">
>> <property name="timeout" value="10"/>
>> <property name="suppressLoggingOnTimeout" value="true"/>
>> <property name="shutdownNowOnTimeout" value="true"/>
>> </bean>
>>
>>
>> On 26 February 2016 at 13:55, David Hoffer <dh...@gmail.com> wrote:
>>
>> > For some reason we are getting the following message from
>> > the DefaultShutdownStrategy "Waiting as there are still 1 inflight and
>> > pending exchanges to complete, timeout in 300 seconds."
>> >
>> > Which causes our app to not shut down for 5 minutes.  This is happening
>> > although there was no work for the app to do.  E.g. we run as a service,
>> > have lots of routes doing file and sftp work but in this case the app
>> > starts no work to process but it gives this message on service shutdown.
>> >  (Happens also when there was work to do.)
>> >
>> > What might be this 1 exchange that is processing?  How can I determine
>> what
>> > it is?  Can I change the shut down strategy to cancel what might be
>> > occurring?
>> >
>> > -Dave
>> >
>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>
>
>

Re: Can't shut down due to inflight and pending exchanges

Posted by Claus Ibsen <cl...@gmail.com>.
See this page
http://camel.apache.org/advanced-configuration-of-camelcontext-using-spring.html

And use the searchbox on the front page of the Camel website to type
in keywords, such as "shutdown" and you can find those relevant links
about graceful shutdown. And the link how to configure it in xml.
http://camel.apache.org/

A good idea to really learn Camel is to buy one of the books
http://camel.apache.org/books

If you use a new version of Camel then when the shutdown hits the
timeout it output detalils about those inflight exchanges and where
they are "stuck" in the routes.

You can also find this at runtime using JMX or in the hawtio web
console which has a page that shows that as well.
http://hawt.io/

On Fri, Feb 26, 2016 at 9:45 PM, David Hoffer <dh...@gmail.com> wrote:
> I found that link too but unfortunately little of it uses the XML
> configuration like we do.
>
> I got it to work...the bean is auto loaded via magic (wish there was less
> magic).  I set our timeout to 30 which works great as when the problem
> occurs we only have to wait 30 seconds instead of 300 for the forceful
> shutdown which is manageable.  The default was so long our tech support
> guys were rebooting the VM because it appeared it was going to hang forever.
>
> -Dave
>
> On Fri, Feb 26, 2016 at 1:34 PM, Matt Sicker <bo...@gmail.com> wrote:
>
>> There's a bit of info at this link:
>>
>> http://camel.apache.org/graceful-shutdown.html
>>
>> On 26 February 2016 at 14:20, David Hoffer <dh...@gmail.com> wrote:
>>
>> > I found a doc that says I can add the following to my camel context.  I
>> > tried it and it worked but then took it out and it still works so this
>> > problem is random it doesn't happen all the time, no idea what is
>> > triggering it yet.
>> >
>> > shutdownRoute="Default" shutdownRunningTask="CompleteCurrentTaskOnly"
>> >
>> > No we aren't using camel-disruptor, I'm not even aware of that.  Thanks
>> for
>> > the bean DefaultShutdownStrategy tip, I'll experiment with that too.
>> >
>> > -Dave
>> >
>> >
>> >
>> > On Fri, Feb 26, 2016 at 1:02 PM, Matt Sicker <bo...@gmail.com> wrote:
>> >
>> > > Are you using camel-disruptor? I had a lot of problems like that.
>> > >
>> > > You could also configure your own DefaultShutdownStrategy and set a
>> > smaller
>> > > timeout. For example:
>> > >
>> > > <bean id="defaultShutdownStrategy"
>> > > class="org.apache.camel.impl.DefaultShutdownStrategy">
>> > > <property name="timeout" value="10"/>
>> > > <property name="suppressLoggingOnTimeout" value="true"/>
>> > > <property name="shutdownNowOnTimeout" value="true"/>
>> > > </bean>
>> > >
>> > >
>> > > On 26 February 2016 at 13:55, David Hoffer <dh...@gmail.com> wrote:
>> > >
>> > > > For some reason we are getting the following message from
>> > > > the DefaultShutdownStrategy "Waiting as there are still 1 inflight
>> and
>> > > > pending exchanges to complete, timeout in 300 seconds."
>> > > >
>> > > > Which causes our app to not shut down for 5 minutes.  This is
>> happening
>> > > > although there was no work for the app to do.  E.g. we run as a
>> > service,
>> > > > have lots of routes doing file and sftp work but in this case the app
>> > > > starts no work to process but it gives this message on service
>> > shutdown.
>> > > >  (Happens also when there was work to do.)
>> > > >
>> > > > What might be this 1 exchange that is processing?  How can I
>> determine
>> > > what
>> > > > it is?  Can I change the shut down strategy to cancel what might be
>> > > > occurring?
>> > > >
>> > > > -Dave
>> > > >
>> > >
>> > >
>> > >
>> > > --
>> > > Matt Sicker <bo...@gmail.com>
>> > >
>> >
>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Can't shut down due to inflight and pending exchanges

Posted by David Hoffer <dh...@gmail.com>.
I found that link too but unfortunately little of it uses the XML
configuration like we do.

I got it to work...the bean is auto loaded via magic (wish there was less
magic).  I set our timeout to 30 which works great as when the problem
occurs we only have to wait 30 seconds instead of 300 for the forceful
shutdown which is manageable.  The default was so long our tech support
guys were rebooting the VM because it appeared it was going to hang forever.

-Dave

On Fri, Feb 26, 2016 at 1:34 PM, Matt Sicker <bo...@gmail.com> wrote:

> There's a bit of info at this link:
>
> http://camel.apache.org/graceful-shutdown.html
>
> On 26 February 2016 at 14:20, David Hoffer <dh...@gmail.com> wrote:
>
> > I found a doc that says I can add the following to my camel context.  I
> > tried it and it worked but then took it out and it still works so this
> > problem is random it doesn't happen all the time, no idea what is
> > triggering it yet.
> >
> > shutdownRoute="Default" shutdownRunningTask="CompleteCurrentTaskOnly"
> >
> > No we aren't using camel-disruptor, I'm not even aware of that.  Thanks
> for
> > the bean DefaultShutdownStrategy tip, I'll experiment with that too.
> >
> > -Dave
> >
> >
> >
> > On Fri, Feb 26, 2016 at 1:02 PM, Matt Sicker <bo...@gmail.com> wrote:
> >
> > > Are you using camel-disruptor? I had a lot of problems like that.
> > >
> > > You could also configure your own DefaultShutdownStrategy and set a
> > smaller
> > > timeout. For example:
> > >
> > > <bean id="defaultShutdownStrategy"
> > > class="org.apache.camel.impl.DefaultShutdownStrategy">
> > > <property name="timeout" value="10"/>
> > > <property name="suppressLoggingOnTimeout" value="true"/>
> > > <property name="shutdownNowOnTimeout" value="true"/>
> > > </bean>
> > >
> > >
> > > On 26 February 2016 at 13:55, David Hoffer <dh...@gmail.com> wrote:
> > >
> > > > For some reason we are getting the following message from
> > > > the DefaultShutdownStrategy "Waiting as there are still 1 inflight
> and
> > > > pending exchanges to complete, timeout in 300 seconds."
> > > >
> > > > Which causes our app to not shut down for 5 minutes.  This is
> happening
> > > > although there was no work for the app to do.  E.g. we run as a
> > service,
> > > > have lots of routes doing file and sftp work but in this case the app
> > > > starts no work to process but it gives this message on service
> > shutdown.
> > > >  (Happens also when there was work to do.)
> > > >
> > > > What might be this 1 exchange that is processing?  How can I
> determine
> > > what
> > > > it is?  Can I change the shut down strategy to cancel what might be
> > > > occurring?
> > > >
> > > > -Dave
> > > >
> > >
> > >
> > >
> > > --
> > > Matt Sicker <bo...@gmail.com>
> > >
> >
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>

Re: Can't shut down due to inflight and pending exchanges

Posted by Matt Sicker <bo...@gmail.com>.
There's a bit of info at this link:

http://camel.apache.org/graceful-shutdown.html

On 26 February 2016 at 14:20, David Hoffer <dh...@gmail.com> wrote:

> I found a doc that says I can add the following to my camel context.  I
> tried it and it worked but then took it out and it still works so this
> problem is random it doesn't happen all the time, no idea what is
> triggering it yet.
>
> shutdownRoute="Default" shutdownRunningTask="CompleteCurrentTaskOnly"
>
> No we aren't using camel-disruptor, I'm not even aware of that.  Thanks for
> the bean DefaultShutdownStrategy tip, I'll experiment with that too.
>
> -Dave
>
>
>
> On Fri, Feb 26, 2016 at 1:02 PM, Matt Sicker <bo...@gmail.com> wrote:
>
> > Are you using camel-disruptor? I had a lot of problems like that.
> >
> > You could also configure your own DefaultShutdownStrategy and set a
> smaller
> > timeout. For example:
> >
> > <bean id="defaultShutdownStrategy"
> > class="org.apache.camel.impl.DefaultShutdownStrategy">
> > <property name="timeout" value="10"/>
> > <property name="suppressLoggingOnTimeout" value="true"/>
> > <property name="shutdownNowOnTimeout" value="true"/>
> > </bean>
> >
> >
> > On 26 February 2016 at 13:55, David Hoffer <dh...@gmail.com> wrote:
> >
> > > For some reason we are getting the following message from
> > > the DefaultShutdownStrategy "Waiting as there are still 1 inflight and
> > > pending exchanges to complete, timeout in 300 seconds."
> > >
> > > Which causes our app to not shut down for 5 minutes.  This is happening
> > > although there was no work for the app to do.  E.g. we run as a
> service,
> > > have lots of routes doing file and sftp work but in this case the app
> > > starts no work to process but it gives this message on service
> shutdown.
> > >  (Happens also when there was work to do.)
> > >
> > > What might be this 1 exchange that is processing?  How can I determine
> > what
> > > it is?  Can I change the shut down strategy to cancel what might be
> > > occurring?
> > >
> > > -Dave
> > >
> >
> >
> >
> > --
> > Matt Sicker <bo...@gmail.com>
> >
>



-- 
Matt Sicker <bo...@gmail.com>

Re: Can't shut down due to inflight and pending exchanges

Posted by David Hoffer <dh...@gmail.com>.
I found a doc that says I can add the following to my camel context.  I
tried it and it worked but then took it out and it still works so this
problem is random it doesn't happen all the time, no idea what is
triggering it yet.

shutdownRoute="Default" shutdownRunningTask="CompleteCurrentTaskOnly"

No we aren't using camel-disruptor, I'm not even aware of that.  Thanks for
the bean DefaultShutdownStrategy tip, I'll experiment with that too.

-Dave



On Fri, Feb 26, 2016 at 1:02 PM, Matt Sicker <bo...@gmail.com> wrote:

> Are you using camel-disruptor? I had a lot of problems like that.
>
> You could also configure your own DefaultShutdownStrategy and set a smaller
> timeout. For example:
>
> <bean id="defaultShutdownStrategy"
> class="org.apache.camel.impl.DefaultShutdownStrategy">
> <property name="timeout" value="10"/>
> <property name="suppressLoggingOnTimeout" value="true"/>
> <property name="shutdownNowOnTimeout" value="true"/>
> </bean>
>
>
> On 26 February 2016 at 13:55, David Hoffer <dh...@gmail.com> wrote:
>
> > For some reason we are getting the following message from
> > the DefaultShutdownStrategy "Waiting as there are still 1 inflight and
> > pending exchanges to complete, timeout in 300 seconds."
> >
> > Which causes our app to not shut down for 5 minutes.  This is happening
> > although there was no work for the app to do.  E.g. we run as a service,
> > have lots of routes doing file and sftp work but in this case the app
> > starts no work to process but it gives this message on service shutdown.
> >  (Happens also when there was work to do.)
> >
> > What might be this 1 exchange that is processing?  How can I determine
> what
> > it is?  Can I change the shut down strategy to cancel what might be
> > occurring?
> >
> > -Dave
> >
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>

Re: Can't shut down due to inflight and pending exchanges

Posted by Matt Sicker <bo...@gmail.com>.
Are you using camel-disruptor? I had a lot of problems like that.

You could also configure your own DefaultShutdownStrategy and set a smaller
timeout. For example:

<bean id="defaultShutdownStrategy"
class="org.apache.camel.impl.DefaultShutdownStrategy">
<property name="timeout" value="10"/>
<property name="suppressLoggingOnTimeout" value="true"/>
<property name="shutdownNowOnTimeout" value="true"/>
</bean>


On 26 February 2016 at 13:55, David Hoffer <dh...@gmail.com> wrote:

> For some reason we are getting the following message from
> the DefaultShutdownStrategy "Waiting as there are still 1 inflight and
> pending exchanges to complete, timeout in 300 seconds."
>
> Which causes our app to not shut down for 5 minutes.  This is happening
> although there was no work for the app to do.  E.g. we run as a service,
> have lots of routes doing file and sftp work but in this case the app
> starts no work to process but it gives this message on service shutdown.
>  (Happens also when there was work to do.)
>
> What might be this 1 exchange that is processing?  How can I determine what
> it is?  Can I change the shut down strategy to cancel what might be
> occurring?
>
> -Dave
>



-- 
Matt Sicker <bo...@gmail.com>