Hi

Yeah just set a higher timeout on the shutdown strategy. You can
access it from the CamelContext.
It's 10 sec by default when using the Camel Test Kit.



On Tue, Feb 8, 2011 at 10:24 AM, Xavier Coulon <xcou...@gmail.com> wrote:
>
> Hello,
>
> [Still working on the unit tests...]
>
> Here are some messages I get in the console during a test that reads 5K
> lines:
>
> Route: route1 suspended and shutdown deferred, was consuming from:
> Endpoint[file:///D:/tmp/data]
> 10:18:37.880 [Camel Thread 20 - ShutdownTask] INFO
> o.a.c.impl.DefaultShutdownStrategy - Waiting as there are still 2613
> inflight and pending exchanges to complete before we can shutdown
> ...
> 10:18:47.326 [Camel Thread 20 - ShutdownTask] INFO
> o.a.c.impl.DefaultShutdownStrategy - Waiting as there are still 342 inflight
> and pending exchanges to complete before we can shutdown
> 10:18:47.888 [Camel Thread 20 - ShutdownTask] WARN
> o.a.c.impl.DefaultShutdownStrategy - Interrupted while waiting during
> graceful shutdown, will force shutdown now.
> 10:18:47.903 [main] WARN  o.a.c.impl.DefaultShutdownStrategy - Timeout
> occurred. Now forcing the routes to be shutdown now.
>
> As you can see, the graceful shutdown times out after 10s, even though there
> are still 1922 inflight and pending exchanges to complete... In this
> particular case, the shutdown is forced and the assertions fail.
>
>
> In another run of the test, I can the following error :
>
> 10:02:11.973 [main] WARN  o.a.c.impl.DefaultInflightRepository - Shutting
> down while there are still 4 in flight exchanges.
> 10:02:11.973 [main] INFO  o.a.camel.impl.DefaultCamelContext - Uptime:
> 21.179 seconds
> 10:02:11.973 [main] INFO  o.a.camel.impl.DefaultCamelContext - Apache Camel
> 2.4.0-fuse-02-00 (CamelContext: camelContext) is shutdown in 10.051 seconds
> 10:02:11.973 [Camel Thread 20 - ShutdownTask] INFO
> o.a.c.impl.DefaultShutdownStrategy - Route: route1 shutdown complete.
> 10:02:12.020 [Camel Thread 2 - seda://dataintegration.filtered.elements]
> ERROR o.a.c.component.seda.SedaConsumer - Error processing exchange.
> Exchange[Message: [{...}]]. Caused by:
> [java.util.concurrent.RejectedExecutionException - null]
> java.util.concurrent.RejectedExecutionException: null
>        at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:216)
> ~[camel-core-2.4.0-fuse-02-00.jar:2.4.0-fuse-02-00]
>        at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202)
> ~[camel-core-2.4.0-fuse-02-00.jar:2.4.0-fuse-02-00]
>        at
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
> ~[camel-core-2.4.0-fuse-02-00.jar:2.4.0-fuse-02-00]
>
> From my understanding, the file consumer is still active. How can I change
> the shutdown strategy to be sure all lines of the input file are consumed ?
>
> Using the following route configuration :
>        from("file:/D:/tmp/data")
>        .shutdownRunningTask(ShutdownRunningTask.CompleteAllTasks)
>        .to("direct:incoming.files");
>
>        // split each line as a message
>        from("direct:incoming.files")
>                .shutdownRunningTask(ShutdownRunningTask.CompleteAllTasks)
>                .split(body().tokenize("\n"))
>                .to("seda:dataintegration.incoming.elements");
>
> does not fix the problem. The 10s timeout still occurs...
>
> Is there any other way that adding a Thread.sleep() ? I'm not happy with
> that : it is not warranted to work on any machine (slower machines may need
> more time), etc...
>
> Thank you in advance.
> Best regards,
> Xavier
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/ETL-how-to-monitor-the-end-of-processing-tp3374562p3375597.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to