You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by srikanthsettivari <sr...@gmail.com> on 2013/12/14 13:48:28 UTC

Unable to stop the route

Hi,
I have configured the route,  like

from("jms:queue:queue1")
			.transacted()			
			.process(new Processmyprocess())
			.to("jms:queue:queue2");

At the time of processing the messages from queue1 to end queue2, if we try
to stop the route, it is not stopping, until all the messages reach to the
queue2.
I am using camelContext.stopRoute(routeName), it is not working.
I want to stop the route irrespective of processing the messages. The route
should stop immediately.

Could you please any one help on this one?



--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-stop-the-route-tp5744772.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to stop the route

Posted by srikanthsettivari <sr...@gmail.com>.
We have givent the shut down strategy for the route like this:

camelContext.getShutdownStrategy().setTimeout(5);
camelContext.getShutdownStrategy().setTimeUnit(TimeUnit.SECONDS);
camelContext.getShutdownStrategy().setShutdownNowOnTimeout(true);

It is not stopping with in 5 seconds, it is taking default time out like 300
seconds,
Is there any way to configure the time out
	



--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-stop-the-route-tp5744772p5744920.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to stop the route

Posted by srikanthsettivari <sr...@gmail.com>.
Hi,
We are using the concurrent consumers to process route the route looks like
this.

 from("jms:queue:queue1 ? concurrentConsumers = 5 & maxConcurrentConsumers =
25 & maxMessagesPerTask=25") 
                        .transacted() 
                        .process(new Processmyprocess()) 
                       .to("jms:queue:queue2"); 


There are thousands of messages in side the queue1 to be processed, the
route is processing the messages from queue1 in between we  are trying to
stop the route using different parameters like:

camelContext.stopRoute(routeId, 5 , TimeUnit.MILLISECONDS, false);

We are unable to stop the route,.

One objervations is
We are able to stop the route , when queue1 is empty.

Could you please any other solution which will fit in to our code ( we are
using camel version 2.9.2)




--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-stop-the-route-tp5744772p5744916.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to stop the route

Posted by "kraythe ." <kr...@gmail.com>.
Or look into why your processor is hanging. Camel tries to gracefully
shutdown so it wont kill exchanges in process until the timeout occurs. So
90% of "my context doesnt shutdown forever" are issues in your route where
exchanges are hanging up. Turn on tracer and look into your processor to
see what is going on.

*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
<http://www.linkedin.com/pub/robert-simmons/40/852/a39>*


On Mon, Dec 16, 2013 at 1:41 AM, Claus Ibsen <cl...@gmail.com> wrote:

> Then set a low timeout value so the route is stopped quicker and
> forced being stopped.
>
> See details at
> http://camel.apache.org/graceful-shutdown.html
>
>
> On Sat, Dec 14, 2013 at 1:48 PM, srikanthsettivari
> <sr...@gmail.com> wrote:
> > Hi,
> > I have configured the route,  like
> >
> > from("jms:queue:queue1")
> >                         .transacted()
> >                         .process(new Processmyprocess())
> >                         .to("jms:queue:queue2");
> >
> > At the time of processing the messages from queue1 to end queue2, if we
> try
> > to stop the route, it is not stopping, until all the messages reach to
> the
> > queue2.
> > I am using camelContext.stopRoute(routeName), it is not working.
> > I want to stop the route irrespective of processing the messages. The
> route
> > should stop immediately.
> >
> > Could you please any one help on this one?
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Unable-to-stop-the-route-tp5744772.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> Make your Camel applications look hawt, try: http://hawt.io
>

Re: Unable to stop the route

Posted by Claus Ibsen <cl...@gmail.com>.
Then set a low timeout value so the route is stopped quicker and
forced being stopped.

See details at
http://camel.apache.org/graceful-shutdown.html


On Sat, Dec 14, 2013 at 1:48 PM, srikanthsettivari
<sr...@gmail.com> wrote:
> Hi,
> I have configured the route,  like
>
> from("jms:queue:queue1")
>                         .transacted()
>                         .process(new Processmyprocess())
>                         .to("jms:queue:queue2");
>
> At the time of processing the messages from queue1 to end queue2, if we try
> to stop the route, it is not stopping, until all the messages reach to the
> queue2.
> I am using camelContext.stopRoute(routeName), it is not working.
> I want to stop the route irrespective of processing the messages. The route
> should stop immediately.
>
> Could you please any one help on this one?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Unable-to-stop-the-route-tp5744772.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io