Hello, If you call stop() directly from the route the current message (the one being processed) is still inflight.
One way to solve it is to start a new thread and and call stop() from there as is described here http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html Best regards Pontus Ullgren On Wed, Jul 11, 2012 at 9:10 PM, anand_tech <[email protected]> wrote: > If this is the case then when all files have been processed then possibly > what can still exist in the inflight exchange, or is it that when it polls > no file it will keep on returning null(since i have enabled > sendemptyMessageIdle option) after some delay(specified by delay). So is > there any method or option for file consumer, that when it polls no file, it > should shutdown. Or what if i explicitly tell the route that if no file is > polled, return null to the bean and from there i shutdown the route myself. > is this any good ? > > Also sometimes i get an error that "direct:InputFile" cannot create a second > consumer error. This happens when i don't stop Camel Context and try to make > another producer template for the endpoint. > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Exact-behaviour-of-Camel-Context-stop-method-tp5715858p5715880.html > Sent from the Camel - Users mailing list archive at Nabble.com.
