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.


Camel community strikes again - Two new components contributed to Apache

The binaries from last 2.1 release has just landed on the various mirrors sites and we already got great stuff coming in the next 2.2 release.

Christian Mueller have recently contributed two new components to Apache Camel they are using in production at his company. This is fantastic as they are production proven components. Thanks a lot.

Christian contributed the FTPS (FTP over SSL) component which now brings the FTP to a total of three variations: regular FTP, SFTP (FTP over SSH) and the new FTPS (FTP over SSL). That is fantastic as if you want FTP then we got all those variations out of the box.

Christian also contributed camel-smpp which integrates Camel with Short Message Center to send and receive SMS. That is fantastic timing as others in the community is on lookout for such a component.

Christian and others keep up to great work. This is another testimony that Camel is all about community and love contributions. Without all these great contributions over the time, Camel wouldn't have the impressive list of components , languages and data formats we do today.


Apache Camel 2.1 released

Its great news that Apache Camel 2.1 is now GA and thus when we come back at work monday morning the Apache mirrors and maven repos have synced the binaries.

As Hadrian wrote in the announcement on the Camel front page its a big release with a record high of 303 tickets resolved.

Hadrian also highlights some new features and whatnot, and I would like to add to that (in no particular order):

  • Vastly improved startup, where Camel validates for correctness upfront and in case of problems a better error is reported back with details in which and where in the route something is wrong
  • You can control startup order of routes, and whether a route should be auto started or not
  • Fixed some race conditions on shutdown which otherwise would make Camel appear as hung
  • Vastly improved bean component to better pick correct method and/or fail
  • Improved error handling with better onException being triggered
  • File and FTP components is more fault tolerant and have build in workarounds for Windows issues with file system
  • XPath is faster on high concurrent load, greatly reduced contention
  • Added Exchange.FAILURE_ENDPOINT when sending to an endpoint failed, which allows you to use that information in your error handling
  • Added in flight repository which is a great step for supporting graceful shutdown
  • and much more... 
Camel 2.2 is already underway and I think we have about 15 tickets fixed already. My next target for work in 2.2 is to add support for graceful shutdown which should allow you to safely stop Camel without loosing messages. In Camel 2.1 you can use JMX to stop Camel and keep an eye on the in flight registry and if its at 0 then you can stop Camel. You can use JMX to stop routes beforehand so no new messages comes in. So we got all the pieces now, its just a matter of letting Camel figure this out on its own, and with the help from the startup order you can aid Camel in some of the very rare situations where route Y must be stopped before route X etc.

Another area I would love to give some love is thread pool configuration which now is possible, but Camel should have a nice and slick configuration for that. If you got any ideas and requirements for this I would love to hear them.

Okay its friday and the World Cup draft is on now. Take care.