You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by "BURN, James" <Ja...@oup.com> on 2015/04/22 12:10:45 UTC

Forcing a camel route to stop

Hi

We're running Karaf 2.3.4  with ServiceMix 5.1.1

Yesterday I tried to stop a Camel route (using "stop 241")

but this has hung in "Stopping" status and I can see is spawning multiple qtp threads.

[ 241] [Stopping   ] [            ] [       ] [   80] 5.0-STARUK-SMXPOST-servicemix-ecloud.xml (0.0.0)

However it appears to have disappeared from the camel:route-list so I wondered if the osgi container has locked.

How do I force this to shutdown?  I've tried various osgi commands in Karaf but to no avail.

When I do
karaf@root> stop 241
^C
Error executing command: Error stopping bundles:
        Unable to stop bundle 241: Bundle 5.0-STARUK-SMXPOST-servicemix-ecloud.xml [241] cannot be stopped since it is already stopping.

Any thoughts?

Cheers

James


Oxford University Press (UK) Disclaimer

This message is confidential. You should not copy it or disclose its contents to anyone. You may use and apply the information for the intended purpose only. OUP does not accept legal responsibility for the contents of this message. Any views or opinions presented are those of the author only and not of OUP. If this email has come to you in error, please delete it, along with any attachments. Please note that OUP may intercept incoming and outgoing email communications.

RE: Forcing a camel route to stop

Posted by "BURN, James" <Ja...@oup.com>.
Hi

I think I probably am. We haven't ever changed shutdown strategy. Is it possible to do this now the route is shutting down?

I think that the number of exchanges (ie messages attempted to be sent) in the ActiveMQ (as inflight) could well be in the 10s of 000s - I guess this could be causing the shutdown delay?

Can we force it to stop through Karaf?

James

-----Original Message-----
From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Sent: 22 April 2015 12:56
To: user@karaf.apache.org
Subject: Re: Forcing a camel route to stop

Hi James,

did you check the Camel shutdown strategy ?

By default, Camel use a graceful shutdown:
- it waits up to 5 mn to all inflight exchanges to be processed
- if after 5 mn, there are still some inflight exchanges, in that case, it destroys those exchanges and stop the route

Maybe you are still in the graceful shutdown ?

Regards
JB

On 04/22/2015 01:50 PM, BURN, James wrote:
> Hi JB
>
> I don't think the camel route is exposing services, but is sending messages to a cloud server dynamic url by:
>
> <setHeader headerName="Exchange.HTTP_URI"><simple>{{ecloud.service.url}}STARUK/${in.header.OUP_STARDBTYPE}/${file:name.noext}</simple></setHeader>	
> <to uri="https://url.set.in.http.uri.header"/>
>
> The camel-context has proxy host definitions at the start. And we have just had trouble with this proxy server - hence my trying to restart the route.
>
> My colleague is suggesting that it may be activemq related and I'll have to pull the plug on ServiceMix, but I wondered if we can do things more gracefully.
>
> Cheers
>
> James
>
>
> -----Original Message-----
> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
> Sent: 22 April 2015 11:59
> To: user@karaf.apache.org
> Subject: Re: Forcing a camel route to stop
>
> Hi James,
>
> Does your XML expose some services used (mandatory) for other bundles ?
>
> It's not so easy to force a stop as we are supposed to wait the BundleActivator stop() method.
>
> Regards
> JB
>
> On 04/22/2015 12:10 PM, BURN, James wrote:
>> Hi
>>
>> We're running Karaf 2.3.4  with ServiceMix 5.1.1
>>
>> Yesterday I tried to stop a Camel route (using "stop 241")
>>
>> but this has hung in "Stopping" status and I can see is spawning 
>> multiple qtp threads.
>>
>> [ 241] [Stopping   ] [            ] [       ] [   80]
>> 5.0-STARUK-SMXPOST-servicemix-ecloud.xml (0.0.0)
>>
>> However it appears to have disappeared from the camel:route-list so I 
>> wondered if the osgi container has locked.
>>
>> How do I force this to shutdown?  I've tried various osgi commands in 
>> Karaf but to no avail.
>>
>> When I do
>>
>> karaf@root> stop 241
>>
>> ^C
>>
>> Error executing command: Error stopping bundles:
>>
>>           Unable to stop bundle 241: Bundle 
>> 5.0-STARUK-SMXPOST-servicemix-ecloud.xml [241] cannot be stopped 
>> since it is already stopping.
>>
>> Any thoughts?
>>
>> Cheers
>>
>> James
>>
>> Oxford University Press (UK) Disclaimer
>>
>> This message is confidential. You should not copy it or disclose its 
>> contents to anyone. You may use and apply the information for the 
>> intended purpose only. OUP does not accept legal responsibility for 
>> the contents of this message. Any views or opinions presented are 
>> those of the author only and not of OUP. If this email has come to 
>> you in error, please delete it, along with any attachments. Please 
>> note that OUP may intercept incoming and outgoing email communications.
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
> Oxford University Press (UK) Disclaimer
>
> This message is confidential. You should not copy it or disclose its contents to anyone. You may use and apply the information for the intended purpose only. OUP does not accept legal responsibility for the contents of this message. Any views or opinions presented are those of the author only and not of OUP. If this email has come to you in error, please delete it, along with any attachments. Please note that OUP may intercept incoming and outgoing email communications.
>

--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Oxford University Press (UK) Disclaimer

This message is confidential. You should not copy it or disclose its contents to anyone. You may use and apply the information for the intended purpose only. OUP does not accept legal responsibility for the contents of this message. Any views or opinions presented are those of the author only and not of OUP. If this email has come to you in error, please delete it, along with any attachments. Please note that OUP may intercept incoming and outgoing email communications.

Re: Forcing a camel route to stop

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi James,

did you check the Camel shutdown strategy ?

By default, Camel use a graceful shutdown:
- it waits up to 5 mn to all inflight exchanges to be processed
- if after 5 mn, there are still some inflight exchanges, in that case, 
it destroys those exchanges and stop the route

Maybe you are still in the graceful shutdown ?

Regards
JB

On 04/22/2015 01:50 PM, BURN, James wrote:
> Hi JB
>
> I don't think the camel route is exposing services, but is sending messages to a cloud server dynamic url by:
>
> <setHeader headerName="Exchange.HTTP_URI"><simple>{{ecloud.service.url}}STARUK/${in.header.OUP_STARDBTYPE}/${file:name.noext}</simple></setHeader>	
> <to uri="https://url.set.in.http.uri.header"/>
>
> The camel-context has proxy host definitions at the start. And we have just had trouble with this proxy server - hence my trying to restart the route.
>
> My colleague is suggesting that it may be activemq related and I'll have to pull the plug on ServiceMix, but I wondered if we can do things more gracefully.
>
> Cheers
>
> James
>
>
> -----Original Message-----
> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
> Sent: 22 April 2015 11:59
> To: user@karaf.apache.org
> Subject: Re: Forcing a camel route to stop
>
> Hi James,
>
> Does your XML expose some services used (mandatory) for other bundles ?
>
> It's not so easy to force a stop as we are supposed to wait the BundleActivator stop() method.
>
> Regards
> JB
>
> On 04/22/2015 12:10 PM, BURN, James wrote:
>> Hi
>>
>> We're running Karaf 2.3.4  with ServiceMix 5.1.1
>>
>> Yesterday I tried to stop a Camel route (using "stop 241")
>>
>> but this has hung in "Stopping" status and I can see is spawning
>> multiple qtp threads.
>>
>> [ 241] [Stopping   ] [            ] [       ] [   80]
>> 5.0-STARUK-SMXPOST-servicemix-ecloud.xml (0.0.0)
>>
>> However it appears to have disappeared from the camel:route-list so I
>> wondered if the osgi container has locked.
>>
>> How do I force this to shutdown?  I've tried various osgi commands in
>> Karaf but to no avail.
>>
>> When I do
>>
>> karaf@root> stop 241
>>
>> ^C
>>
>> Error executing command: Error stopping bundles:
>>
>>           Unable to stop bundle 241: Bundle
>> 5.0-STARUK-SMXPOST-servicemix-ecloud.xml [241] cannot be stopped since
>> it is already stopping.
>>
>> Any thoughts?
>>
>> Cheers
>>
>> James
>>
>> Oxford University Press (UK) Disclaimer
>>
>> This message is confidential. You should not copy it or disclose its
>> contents to anyone. You may use and apply the information for the
>> intended purpose only. OUP does not accept legal responsibility for
>> the contents of this message. Any views or opinions presented are
>> those of the author only and not of OUP. If this email has come to you
>> in error, please delete it, along with any attachments. Please note
>> that OUP may intercept incoming and outgoing email communications.
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
> Oxford University Press (UK) Disclaimer
>
> This message is confidential. You should not copy it or disclose its contents to anyone. You may use and apply the information for the intended purpose only. OUP does not accept legal responsibility for the contents of this message. Any views or opinions presented are those of the author only and not of OUP. If this email has come to you in error, please delete it, along with any attachments. Please note that OUP may intercept incoming and outgoing email communications.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

RE: Forcing a camel route to stop

Posted by "BURN, James" <Ja...@oup.com>.
Hi JB

I don't think the camel route is exposing services, but is sending messages to a cloud server dynamic url by:

<setHeader headerName="Exchange.HTTP_URI"><simple>{{ecloud.service.url}}STARUK/${in.header.OUP_STARDBTYPE}/${file:name.noext}</simple></setHeader>	
<to uri="https://url.set.in.http.uri.header"/>

The camel-context has proxy host definitions at the start. And we have just had trouble with this proxy server - hence my trying to restart the route.

My colleague is suggesting that it may be activemq related and I'll have to pull the plug on ServiceMix, but I wondered if we can do things more gracefully.

Cheers

James


-----Original Message-----
From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Sent: 22 April 2015 11:59
To: user@karaf.apache.org
Subject: Re: Forcing a camel route to stop

Hi James,

Does your XML expose some services used (mandatory) for other bundles ?

It's not so easy to force a stop as we are supposed to wait the BundleActivator stop() method.

Regards
JB

On 04/22/2015 12:10 PM, BURN, James wrote:
> Hi
>
> We're running Karaf 2.3.4  with ServiceMix 5.1.1
>
> Yesterday I tried to stop a Camel route (using "stop 241")
>
> but this has hung in "Stopping" status and I can see is spawning 
> multiple qtp threads.
>
> [ 241] [Stopping   ] [            ] [       ] [   80]
> 5.0-STARUK-SMXPOST-servicemix-ecloud.xml (0.0.0)
>
> However it appears to have disappeared from the camel:route-list so I 
> wondered if the osgi container has locked.
>
> How do I force this to shutdown?  I've tried various osgi commands in 
> Karaf but to no avail.
>
> When I do
>
> karaf@root> stop 241
>
> ^C
>
> Error executing command: Error stopping bundles:
>
>          Unable to stop bundle 241: Bundle 
> 5.0-STARUK-SMXPOST-servicemix-ecloud.xml [241] cannot be stopped since 
> it is already stopping.
>
> Any thoughts?
>
> Cheers
>
> James
>
> Oxford University Press (UK) Disclaimer
>
> This message is confidential. You should not copy it or disclose its 
> contents to anyone. You may use and apply the information for the 
> intended purpose only. OUP does not accept legal responsibility for 
> the contents of this message. Any views or opinions presented are 
> those of the author only and not of OUP. If this email has come to you 
> in error, please delete it, along with any attachments. Please note 
> that OUP may intercept incoming and outgoing email communications.
>

--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Oxford University Press (UK) Disclaimer

This message is confidential. You should not copy it or disclose its contents to anyone. You may use and apply the information for the intended purpose only. OUP does not accept legal responsibility for the contents of this message. Any views or opinions presented are those of the author only and not of OUP. If this email has come to you in error, please delete it, along with any attachments. Please note that OUP may intercept incoming and outgoing email communications.

Re: Forcing a camel route to stop

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi James,

Does your XML expose some services used (mandatory) for other bundles ?

It's not so easy to force a stop as we are supposed to wait the 
BundleActivator stop() method.

Regards
JB

On 04/22/2015 12:10 PM, BURN, James wrote:
> Hi
>
> We’re running Karaf 2.3.4  with ServiceMix 5.1.1
>
> Yesterday I tried to stop a Camel route (using “stop 241”)
>
> but this has hung in “Stopping” status and I can see is spawning
> multiple qtp threads.
>
> [ 241] [Stopping   ] [            ] [       ] [   80]
> 5.0-STARUK-SMXPOST-servicemix-ecloud.xml (0.0.0)
>
> However it appears to have disappeared from the camel:route-list so I
> wondered if the osgi container has locked.
>
> How do I force this to shutdown?  I’ve tried various osgi commands in
> Karaf but to no avail.
>
> When I do
>
> karaf@root> stop 241
>
> ^C
>
> Error executing command: Error stopping bundles:
>
>          Unable to stop bundle 241: Bundle
> 5.0-STARUK-SMXPOST-servicemix-ecloud.xml [241] cannot be stopped since
> it is already stopping.
>
> Any thoughts?
>
> Cheers
>
> James
>
> Oxford University Press (UK) Disclaimer
>
> This message is confidential. You should not copy it or disclose its
> contents to anyone. You may use and apply the information for the
> intended purpose only. OUP does not accept legal responsibility for the
> contents of this message. Any views or opinions presented are those of
> the author only and not of OUP. If this email has come to you in error,
> please delete it, along with any attachments. Please note that OUP may
> intercept incoming and outgoing email communications.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com