Hi Claus,

with the usage of ScheduledBatchPollingConsumer and it's derivates inside
routes there's an issue while doing context.stopRoute("myCoolRoute") as
Camel tries to shutdown the route gracefully and as the mentioned class
does:

        if (answer == 0 && isPolling()) {
            // force at least one pending exchange if we are polling as
there is a little gap
            // in the processBatch method and until an exchange gets
enlisted as in-flight
            // which happens later, so we need to signal back to the
shutdown strategy that
            // there is a pending exchange. When we are no longer polling,
then we will return 0
            LOG.trace("Currently polling so returning 1 as pending
exchanges");
            answer = 1;
        }

it waits and waits until the (30 seconds) timeout reaches although no *real*
inflight exchanges are available at all! I realized this behavior as I was
trying to provide a working example for the user (you see already by this
thread).

However doing main.stop() (as by the upper example) did *not* behave like
this!

A possible fix (may be dirty) would be to check that if we already returned
X times a hard-coded value of 1 then we should better return 0 instead to
signal there's no real inflight exchange available.

Babak


--
View this message in context: 
http://camel.465427.n5.nabble.com/File-consumer-waiting-for-it-to-start-tp5455062p5458048.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to