X-mas present to Apache Camel - Graceful Shutdown

I am currently on x-mas holiday and enjoy the time with family and friends. However I am also a man with obligations as I am a co-author on the Camel in Action book. My next chapter is chapter 11 which covers management and monitoring Camel.

You can say that my research for that chapter took my round the areas of how to manage Camel and therefore also how to properly operate it for example in cases where you need to restart Camel. To restart you need to stop Camel, and to stop in a safe manner you need to graceful stop. Yeah now we get to the point of this blog title.

So besides working for Progress, writing on the book and the usual x-mas last minute must buy gifts, I have been working on adding graceful shutdown for Apache Camel. As of today I have committed the last pieces of the puzzle. So from Apache Camel 2.2 onwards we got Graceful shutdown supported in Camel. It follows the principle with Camel, that everything is more or less pluggable and configurable as much as possible. This gives you full powers at your fingertips to tweak and configure it to tailor your needs. And in some rare cases you can just plugin you own graceful shutdown strategy and deal with it.

Oh and its enabled by default so you get it right out of the box. You can checkout the Camel documentation for details and screenshots - cough well its some log lines showing it in action.

As James Strachan pointed out, its book driven development :) Yeah I must admit that during our work on the book we have encountered some areas to be improved, new features to be introduced etc. So its a win win situation.

We do have an ongoing discussion on the graceful shutdown which you can read about and provide feedback etc. The JIRA ticket is CAMEL-1483. Which is a somewhat older ticket. And readers of my blog my remember that I wrote on the Camel 2.1 announcement that graceful shutdown is a high priority feature to get in 2.2.

So what is next? Well chapter 11 and better thread pool configuration :)

Have a merry x-mas and a happy new year. See you in 2010.


Unknown said...

I've been trying to figure out how graceful shutdown works with aggregator and shutdownRunningTask="CompleteAllTasks".

If I use a completionInterval="5000", would that mean that my messages successfully get processed given that shutdown takes longer than 5 seconds? Would shutdownRoute="Defer" help in this case?

What would happen if I use completionSize=5 and I only have 4 messages? Would these messages get processed properly?

Claus Ibsen said...

Chris. Could you use the discussion forum or mailing list to discuss issues when using Camel. That is much easier and more people can see and help you.

See links here: