Hi I am posting this to the user forum of Camel to a broader audience.
I have just added Graceful Shutdown to Camel 2.2 (trunk code will be committed shortly). https://issues.apache.org/activemq/browse/CAMEL-1483 The wiki page is here http://cwiki.apache.org/confluence/display/CAMEL/Graceful+Shutdown I have enabled it by default on trunk, which means the shutdown process is altered. You can read all about it on the wiki page. As its new code I would love feedback and having people giving it a test run on your systems. There is one note, the SEDA/VM components uses an internal in memory queue with pending exchanges to be processed. The graceful shutdown will take this into account and wait until all those pending messages have been run to completion. The progress is logged at INFO level such as shown on the wiki page. If there are other Camel components which have the same behavior, please let me know, as I could not remember any other that did. If so we need to let its consumer implements the ShutdownAware interface which ensures the graceful shutdown can work with it. I have set a default timeout of 300 seconds for the hole shutdown process. During this time any pending and inflight exchanges should be run to completion. Camel will of course stop input consumers before hand which ensures no new messages come into Camel. And therefore its just a matter of waiting until all those existing messages runs to completion. If you think this timeout should have a different default value, then speak up. What happens if the timeout is hit, then Camel will do a shutdown now, where it forces all routes to shutdown and shutdown the remainder services. This ensures that Camel will not block forever during shutdown. I have one questions although ====================== We have a batch consumer concept which allows a consumer to batch up a number of exchanges to be routed. For example: file, ftp, mail, jpa and others implement this. The current gracful shutdown behavior is to stop during this batch. What happens is that lets say there are 23 messages in the batch and it has completed 7 of those. Then a shutdown is issued. The batch consumer will complete its current inprogress, and therefore it has completed 8. There are still 15 left in the batch. What happens is that it will break and not complete the batch. Do you think we should offer a configuration which allows the batch consumers to control their behavior to - stop as now during a batch - continue to complete the batch before shutting down -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus