You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by rodgersh <hu...@lmco.com> on 2013/09/17 23:27:20 UTC

FileConsumer in a route is not stopped when the route is stopped

Hello -

I create a camel route dynamically at runtime that is like:

from("file://inbox?delete=true&moveFailed=.errors").to("content://framework")

The route works fine. If I drop a file in the /inbox directory it is
processed by the route.

Then when I delete the OSGi managed service factory that contains the route,
my destroy() method is invoked and I stop the route, then remove the route.
>From the camel logging, I see that the route was indeed stopped, shutdown,
and removed. But if I drop a file in the /inbox directory it is still
processed. I look in jconsole and see that the route has been removed, but
the route's FileConsumer still exists and is still in the "Started" state.
If I stop the FileConsumer (using the stop() button under Operations in
jconsole) the FileConsumer's state goes to "Stopped" and now if I drop the
file into /inbox it is not processed (as desired).

What am I doing wrong in stopping/removing this route programmatically?

Thanks for any help or ideas.

Hugh



--
View this message in context: http://camel.465427.n5.nabble.com/FileConsumer-in-a-route-is-not-stopped-when-the-route-is-stopped-tp5739690.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: FileConsumer in a route is not stopped when the route is stopped

Posted by Willem jiang <wi...@gmail.com>.
Which version of Camel were you using?
How did stop the route?
If you stop the route, the FileConsumer should be stopped at the same time.


--  
Willem Jiang

Red Hat, Inc.
Web: 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, September 18, 2013 at 5:27 AM, rodgersh wrote:

> Hello -
>  
> I create a camel route dynamically at runtime that is like:
>  
> from("file://inbox?delete=true&moveFailed=.errors").to("content://framework")
>  
> The route works fine. If I drop a file in the /inbox directory it is
> processed by the route.
>  
> Then when I delete the OSGi managed service factory that contains the route,
> my destroy() method is invoked and I stop the route, then remove the route.
> From the camel logging, I see that the route was indeed stopped, shutdown,
> and removed. But if I drop a file in the /inbox directory it is still
> processed. I look in jconsole and see that the route has been removed, but
> the route's FileConsumer still exists and is still in the "Started" state.
> If I stop the FileConsumer (using the stop() button under Operations in
> jconsole) the FileConsumer's state goes to "Stopped" and now if I drop the
> file into /inbox it is not processed (as desired).
>  
> What am I doing wrong in stopping/removing this route programmatically?
>  
> Thanks for any help or ideas.
>  
> Hugh
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/FileConsumer-in-a-route-is-not-stopped-when-the-route-is-stopped-tp5739690.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Re: FileConsumer in a route is not stopped when the route is stopped

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

How do you stop the route?

You should use the API on CamelContext, it has a stopRoute /
remoteRoute you can use to first stop and remove.



On Tue, Sep 17, 2013 at 11:27 PM, rodgersh <hu...@lmco.com> wrote:
> Hello -
>
> I create a camel route dynamically at runtime that is like:
>
> from("file://inbox?delete=true&moveFailed=.errors").to("content://framework")
>
> The route works fine. If I drop a file in the /inbox directory it is
> processed by the route.
>
> Then when I delete the OSGi managed service factory that contains the route,
> my destroy() method is invoked and I stop the route, then remove the route.
> From the camel logging, I see that the route was indeed stopped, shutdown,
> and removed. But if I drop a file in the /inbox directory it is still
> processed. I look in jconsole and see that the route has been removed, but
> the route's FileConsumer still exists and is still in the "Started" state.
> If I stop the FileConsumer (using the stop() button under Operations in
> jconsole) the FileConsumer's state goes to "Stopped" and now if I drop the
> file into /inbox it is not processed (as desired).
>
> What am I doing wrong in stopping/removing this route programmatically?
>
> Thanks for any help or ideas.
>
> Hugh
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/FileConsumer-in-a-route-is-not-stopped-when-the-route-is-stopped-tp5739690.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