| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> |
| <title>ActiveMQ</title> |
| <link rel="icon" type="image/png" href="/assets/img/favicon.png"> |
| |
| <link rel="stylesheet" href="/css/main.css"> |
| <script defer src="/js/fontawesome-all.min.js" integrity="sha384-rOA1PnstxnOBLzCLMcre8ybwbTmemjzdNlILg8O7z1lUkLXozs4DHonlDtnE7fpc"></script> |
| <script src="/js/jquery.slim.min.js" integrity="sha384-5AkRS45j4ukf+JbWAfHL8P4onPA9p0KwwP7pUdjSQA3ss9edbJUJc/XcYAiheSSz"></script> |
| <script src="/js/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"></script> |
| <script src="/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"></script> |
| </head> |
| |
| <body> |
| <nav class="navbar navbar-expand-lg navbar-light fixed-top"> |
| <div class="container"> |
| <!-- <a class="navbar-brand mr-auto" href="#"><img style="height: 50px" src="assets/img/apache-feather.png" /></a> --> |
| <a class="navbar-brand mr-auto" href="/"><img src="/assets/img/activemq_logo_black_small.png" style="height: 50px"/></a> |
| <button class="navbar-toggler ml-auto" type="button" data-toggle="collapse" data-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation"> |
| <span class="navbar-toggler-icon"></span> |
| </button> |
| |
| <div class="ml-auto collapse navbar-collapse" id="navbarContent"> |
| <ul class="navbar-nav ml-auto"> |
| <li class="nav-item"> |
| <a class="nav-link active" href="/news">News</a> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class="nav-link" id="navbarDropdownComponents" data-target="#" href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Components<span class="caret"></span></a> |
| <ul class="dropdown-menu dropdown-menu-center" aria-labelledby="navbarDropdownComponents"> |
| <div class="row"> |
| <div class="col-12"> |
| <ul class="multi-column-dropdown"> |
| <li class="nav-item"><a class="dropdown-item" href="/components/classic">ActiveMQ Classic</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/components/artemis/">ActiveMQ Artemis</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/components/nms">NMS Clients</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/components/cms">CMS Client</a></li> |
| </ul> |
| </div> |
| </div> |
| </ul> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class="nav-link" id="navbarDropdownCommunity" data-target="#" href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Community<span class="caret"></span></a> |
| <ul class="dropdown-menu dropdown-menu-center multi-column columns-1" aria-labelledby="navbarDropdownCommunity"> |
| <div class="row"> |
| <div class="col-12"> |
| <ul class="multi-column-dropdown"> |
| <li class="nav-item"><a class="dropdown-item" href="/contact">Contact Us</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/contributing">Contribute</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/issues">Report Issues</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/support">Get Support</a></li> |
| </ul> |
| </div> |
| </div> |
| </ul> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class="nav-link" id="navbarDropdownTeam" data-target="#" href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><img src="/assets/img/feather.png" style="height:20px">Apache<span class="caret"></span></a> |
| <ul class="dropdown-menu dropdown-menu-center multi-column columns-1" aria-labelledby="navbarDropdownTeam"> |
| <div class="row"> |
| <div class="col-sm-12"> |
| <ul class="multi-column-dropdown"> |
| <li class="nav-item"><a class="dropdown-item" href="https://www.apache.org">The Apache Software Foundation</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="https://www.apache.org/licenses/">License</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="https://www.apache.org/foundation/thanks.html">Thanks</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="/security-advisories">Security</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="https://www.apache.org/events/current-event">Events</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="https://people.apache.org/phonebook.html?pmc=activemq">PMC & Committers</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="https://whimsy.apache.org/board/minutes/ActiveMQ.html">Board Reports</a></li> |
| <li class="nav-item"><a class="dropdown-item" href="https://privacy.apache.org/policies/privacy-policy-public.html">Privacy Policy</a></li> |
| </ul> |
| </div> |
| </div> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </nav> |
| |
| <div class="content"> |
| <div class="page-title-classic"> |
| <div class="container"> |
| <h1>Enterprise Integration Patterns</h1> |
| </div> |
| </div> |
| <div class="container" > |
| <div class="row" style="margin-top: 30px"> |
| <div class="col-12 classic"> |
| <p><a href="features">Features</a> > <a href="enterprise-integration-patterns">Enterprise Integration Patterns</a></p> |
| |
| <h2 id="enterprise-integration-patterns">Enterprise Integration Patterns</h2> |
| |
| <p>Version 5.0 onwards of Apache ActiveMQ Classic comes complete with full support for the <a href="http://www.enterpriseintegrationpatterns.com/toc.html">Enterprise Integration Patterns</a> (from the excellent book by <a href="http://www.amazon.com/exec/obidos/search-handle-url/105-9796798-8100401?%5Fencoding=UTF8&search-type=ss&index=books&field-author=Gregor%20Hohpe">Gregor Hohpe</a> and <a href="http://www.amazon.com/exec/obidos/search-handle-url/105-9796798-8100401?%5Fencoding=UTF8&search-type=ss&index=books&field-author=Bobby%20Woolf">Bobby Woolf</a>) via the <a href="http://activemq.apache.org/camel/">Apache Camel library</a>.</p> |
| |
| <p>You can easily add any of the supported <a href="enterprise-integration-patterns">Enterprise Integration Patterns</a> 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 embed <a href="http://activemq.apache.org/camel/">Camel library</a> directly into your application, such as via <a href="http://activemq.apache.org/camel/spring.html">Spring</a> as well..</p> |
| |
| <p>This also means you can cleanly integrate all of the <a href="http://activemq.apache.org/camel/components.html">Camel Components</a> into ActiveMQ Classic so you can easily integrate with <a href="http://activemq.apache.org/camel/cxf.html">CXF</a>, <a href="http://activemq.apache.org/camel/file.html">Files</a>, <a href="http://activemq.apache.org/camel/jbi.html">JBI</a>, <a href="http://activemq.apache.org/camel/jpa.html">JPA</a>, <a href="http://activemq.apache.org/camel/mail.html">Mail</a>, <a href="http://activemq.apache.org/camel/mina.html">MINA</a>, <a href="http://activemq.apache.org/camel/quartz.html">Quartz</a>, <a href="http://activemq.apache.org/camel/xmpp">XMPP</a> and <a href="http://activemq.apache.org/camel/components.html">many other protocols and transports!</a></p> |
| |
| <h3 id="using-eip-in-the-activemq-classic-broker">Using EIP in the ActiveMQ Classic Broker</h3> |
| |
| <p>The broker’s <code class="language-plaintext highlighter-rouge">activemq.xml</code> file comes already configured to support Camel; you just need to customize the routing rules.</p> |
| |
| <h4 id="writing-eip-rules-using-java-code">Writing EIP rules using Java code</h4> |
| |
| <p>To use <a href="http://activemq.apache.org/camel/dsl.html">Java code to write EIP routing rules</a>, 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 the <strong>packages</strong> attribute points to the package name (or a parent package name) to look for.</p> |
| |
| <p>For example if all your routes are in the package <code class="language-plaintext highlighter-rouge">org.acme.cheese</code> such as <code class="language-plaintext highlighter-rouge">org.acme.cheese.whatnot.MyRouter</code> then you could edit the XML to be…</p> |
| <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code><camelContext xmlns="http://activemq.apache.org/camel/schema/spring"> |
| <package>org.acme.cheese</package> |
| </camelContext> |
| </code></pre></div></div> |
| |
| <h4 id="writing-eip-rules-using-xml">Writing EIP rules using XML</h4> |
| |
| <p>To use XML its even easier, as you can just embed whatever routing rules inside the <code class="language-plaintext highlighter-rouge"><camelContext></code> element using Camel’s <a href="http://activemq.apache.org/camel/xml-configuration">Spring XML format</a>. Note that the XML is way more verbose than the <a href="http://activemq.apache.org/camel/dsl.html">Java DSL</a> but it is a bit simpler to deploy. e.g. for a trivial route…</p> |
| <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code><camelContext xmlns="http://activemq.apache.org/camel/schema/spring"> |
| <route> |
| <from uri="activemq:com.acme.MyQueue"/> |
| <to uri="activemq:com.acme.SomeOtherQueue"/> |
| </route> |
| </camelContext> |
| </code></pre></div></div> |
| <h3 id="using-eip-in-the-jms-client">Using EIP in the JMS client</h3> |
| |
| <p>You can use <a href="http://activemq.apache.org/camel/">Camel</a> <a href="http://activemq.apache.org/camel/endpoint.html">Endpoints</a> directly from your JMS client one of the following JMS destinations, depending on what JMS API you want it to use</p> |
| |
| <ul> |
| <li><a href="http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/camel/CamelDestination.html">CamelDestination</a></li> |
| <li><a href="http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/camel/CamelQueue.html">CamelQueue</a></li> |
| <li><a href="http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/camel/CamelTopic.html">CamelTopic</a></li> |
| </ul> |
| |
| <p>You can then use this destination like any other JMS destination when sending or receiving messages! This means you can use any of the <a href="http://activemq.apache.org/camel/components.html">large number of Camel components</a> from your JMS code, by just changing the Destination object!</p> |
| |
| <h3 id="see-also">See Also</h3> |
| |
| <ul> |
| <li><a href="http://activemq.apache.org/camel/enterprise-integration-patterns">Enterprise Integration Patterns</a></li> |
| <li><a href="http://activemq.apache.org/camel/components.html">Camel Components</a></li> |
| <li><a href="http://activemq.apache.org/camel/xml-reference">Camel XML Reference</a></li> |
| </ul> |
| |
| |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="row sitemap"> |
| <div class="col-sm-12"> |
| <div class="container"> |
| <div class="row"> |
| <div class="col-sm-12"> |
| <div class="row"> |
| <div class="col-sm-3"> |
| <div > |
| <img class="float-left" style="max-height: 100px" src="/assets/img/activemq_logo_white_vertical_small.png"/> |
| </div> |
| </div> |
| <div style="text-align: center; margin-bottom: 0px; margin-top: 30px; font-size: 65%" class="col-sm-6"> |
| <p><a href="https://www.apache.org/foundation/marks/list/">Apache, ActiveMQ, Apache ActiveMQ</a>, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. Copyright © 2024, The Apache Software Foundation. Licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.</p> |
| </div> |
| <div class="col-sm-3"> |
| <div > |
| <a href="https://www.apache.org"><img class="float-right" style="margin-top: 10px; max-height: 80px" src="/assets/img/apache-logo-small.png"/></a> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| |
| </body> |
| </html> |