Hi

You can use suspend/resume on the route, if you just want it temporary
paused for a while. Then the thread pools and whatnot is kept alive.

See lifecycle details at
http://camel.apache.org/lifecycle


On Fri, May 3, 2013 at 10:07 AM, mdo <manfred.doh...@gmail.com> wrote:
> Hello Claus,
>
>
> Claus Ibsen-2 wrote
>> Check this page again as its updated how to stop a route from a route
>> http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html
>
> in fact this is what I'm doing. Also, when I look at the page's history
> (<https://cwiki.apache.org/confluence/pages/viewpreviousversions.action?pageId=23339650>)
> it seems that the last change dates back to 2012 (if the history is
> correct).
>
>
> Claus Ibsen-2 wrote
>> Also there was a bug so the MBean for the scheduled thread pool was
>> not removed when you removed the route.
>
> I don't remove the route — do I have to? I stop the route and on the next
> Quartz run a processor does start the route again which results in a new
> thread.
>
>
> Claus Ibsen-2 wrote
>> This has been fixed in 2.11.0, and upcoming releases of 2.10.x.
>> The thread pool is stopped though. Its just the mbean not being removed.
>
> I'm using 2.11.0.
>
> This is my current process method for stopping the route:
>
>     @Override
>     public void process(final Exchange exchange) throws Exception {
>         if (stop == null || !stop.isAlive()) {
>             stop = new Thread() {
>                 @Override
>                 public void run() {
>                     try {
>
> exchange.getContext().stopRoute(exchange.getFromRouteId());
>                     } catch (Exception e) {
>                         logger.error(e.getMessage());
>                     }
>                 }
>             };
>         }
>         stop.start();
>     }
>
> The additional check for isAlive is there because the processor instance is
> reused with each route-start-stop-cycle.
>
> Regards, mdo.
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/2-11-File2-Quartz-threads-leaking-tp5731922p5731956.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: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to