Thanks Claus, I can confirm that suspend-resume-cycles resolve my problem of
leaked threads.

I'm now doing a selective start:
        if (!context.getRouteStatus(routeId).isStarted()) {
            context.startRoute(routeId);
        } else {
            context.resumeRoute(routeId);
        }

... and changed stopRoute() to suspendRoute():
            //camelContext.stopRoute(routeId);
            camelContext.suspendRoute(routeId);

The docs regarding the lifecycle state: 
"End users is encouraged to use suspend/resume if you are temporary stopping
a Camel application."

But I'm quite unsure: am I not supposed to re-start a stopped route, do you
consider the piling of threads a bug in Camel or a mis-usage?

I don't have an URL at hand but I remember that I found advice to use a
Quartz trigger to periodically start and stop a route on this list. Maybe
you could point out the pitfalls in the wiki somewhat more emphasized? Seems
a pretty usual use case to me.

My intention in stopping the route was to completely clean up the
environment (without removing the route definition itself). By now I see
that a suspended FTP2/SFTP endpoint keeps the remote connection open. Will
go and shut it down somehow else now ...

Regards, mdo.





--
View this message in context: 
http://camel.465427.n5.nabble.com/2-11-File2-Quartz-threads-leaking-tp5731922p5731963.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to