Some time ago I read the excellent Enterprise Integration Patterns book and I’ve wanted to leverage the concepts detailed in the book in my own work. Eventually I found the Apache Camel project and have been impressed with how quickly I was able to integrate it into my application.
Camel is essentially a message router that allows you define routing and mediation rules using either a domain specific language (DSL) or XML. Here’s an example of a rule I’m currently using in production:
from("jms:queue:schedule"). choice(). when().xpath("/UpdateSchedule").to("filter:updateSchedule"). otherwise().to("filter:removeSchedule"). end();
This is an asynchronous route that accepts an incoming XML payload via JMS and routes it to the correct filter component based on the root element. (While the filter component is a custom component, but it could just as easily be a simple bean invocation, or any other component supported by Camel.)
The more time I spend exploring Camel, the more impressed I am with it. I plan on making it a permanent fixture in my application stack for client projects.