Features > Enterprise Integration Patterns
Version 5.0 onwards of Apache ActiveMQ Classic comes complete with full support for theEnterprise Integration Patterns (from the excellent book byGregor Hohpe andBobby Woolf) via theApache Camel library.
You can easily add any of the supportedEnterprise Integration Patterns into ActiveMQ Classic (either on the JMS client or in the broker process) to support smart routing, transformation and a whole host of other powerful patterns. You can of course just embedCamel library directly into your application, such as viaSpring as well..
This also means you can cleanly integrate all of theCamel Components into ActiveMQ Classic so you can easily integrate withCXF,Files,JBI,JPA,Mail,MINA,Quartz,XMPP andmany other protocols and transports!
The broker’sactivemq.xml
file comes already configured to support Camel; you just need to customize the routing rules.
To useJava code to write EIP routing rules, just put your classes on the classpath (such as in activemq/lib/myroutes/foo.jar). Then to get Camel to find your routes you need to edit the activemq.xml so that thepackages attribute points to the package name (or a parent package name) to look for.
For example if all your routes are in the packageorg.acme.cheese
such asorg.acme.cheese.whatnot.MyRouter
then you could edit the XML to be…
<camelContext xmlns="http://activemq.apache.org/camel/schema/spring"> <package>org.acme.cheese</package></camelContext>
To use XML its even easier, as you can just embed whatever routing rules inside the<camelContext>
element using Camel’sSpring XML format. Note that the XML is way more verbose than theJava DSL but it is a bit simpler to deploy. e.g. for a trivial route…
<camelContext xmlns="http://activemq.apache.org/camel/schema/spring"> <route> <from uri="activemq:com.acme.MyQueue"/> <to uri="activemq:com.acme.SomeOtherQueue"/> </route></camelContext>
You can useCamelEndpoints directly from your JMS client one of the following JMS destinations, depending on what JMS API you want it to use
You can then use this destination like any other JMS destination when sending or receiving messages! This means you can use any of thelarge number of Camel components from your JMS code, by just changing the Destination object!
Apache, ActiveMQ, Apache ActiveMQ, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. Copyright © 2025, The Apache Software Foundation. Licensed underApache License 2.0.