You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "babu.sona2001" <ba...@gmail.com> on 2013/01/08 09:06:02 UTC

Polling consumer does not stop when pollStrategy specified

I have as follows. I want to stop it, modify and start it.

from('file://D:/temp/20130801/inbound?pollStrategy=#errorHandlerService')
    .routeId("routeId")
        .to("stream:out")

My pollStrategy looks like:
class ErrorHandlerService extends DefaultPollingConsumerPollStrategy {
}

The following call does not stop the route.
camelContext.getRoute("routeId").getConsumer().stop()

If I remove the pollStrategy from URI, it works fine. I tried a lot. But
could not figure out what's wrong. :(.

Thanks
Babu



--
View this message in context: http://camel.465427.n5.nabble.com/Polling-consumer-does-not-stop-when-pollStrategy-specified-tp5725104.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Polling consumer does not stop when pollStrategy specified

Posted by Willem jiang <wi...@gmail.com>.
Can you check if the files are pulled already?
If there is no new file to be pulled, the stream:out will not print any things out.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Wednesday, January 9, 2013 at 2:52 AM, babu.sona2001 wrote:

> Sorry.. I take that back. camelContext.stopRoute() stops the route. But then,
> if I call camelCOntext.startRoute(), only the file polling is started. It
> does not print anything in console. What happens to stream:out?
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Polling-consumer-does-not-stop-when-pollStrategy-specified-tp5725104p5725143.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Re: Polling consumer does not stop when pollStrategy specified

Posted by "babu.sona2001" <ba...@gmail.com>.
Sorry.. I take that back. camelContext.stopRoute() stops the route. But then,
if I call camelCOntext.startRoute(), only the file polling is started. It
does not print anything in console. What happens to stream:out?



--
View this message in context: http://camel.465427.n5.nabble.com/Polling-consumer-does-not-stop-when-pollStrategy-specified-tp5725104p5725143.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Polling consumer does not stop when pollStrategy specified

Posted by "babu.sona2001" <ba...@gmail.com>.
Claus,
I tried that it did not work either.



--
View this message in context: http://camel.465427.n5.nabble.com/Polling-consumer-does-not-stop-when-pollStrategy-specified-tp5725104p5725141.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Polling consumer does not stop when pollStrategy specified

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

There is API on CamelContext to stop routes by its id

camelContext.stopRoute("routeId");


On Tue, Jan 8, 2013 at 9:06 AM, babu.sona2001 <ba...@gmail.com> wrote:
> I have as follows. I want to stop it, modify and start it.
>
> from('file://D:/temp/20130801/inbound?pollStrategy=#errorHandlerService')
>     .routeId("routeId")
>         .to("stream:out")
>
> My pollStrategy looks like:
> class ErrorHandlerService extends DefaultPollingConsumerPollStrategy {
> }
>
> The following call does not stop the route.
> camelContext.getRoute("routeId").getConsumer().stop()
>
> If I remove the pollStrategy from URI, it works fine. I tried a lot. But
> could not figure out what's wrong. :(.
>
> Thanks
> Babu
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Polling-consumer-does-not-stop-when-pollStrategy-specified-tp5725104.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen