Modified: websites/production/camel/content/book-in-one-page.html
==============================================================================
--- websites/production/camel/content/book-in-one-page.html (original)
+++ websites/production/camel/content/book-in-one-page.html Tue Apr 23 17:20:32 
2019
@@ -106,7 +106,7 @@
 <div class="chapter page-reset conf-macro output-block conf-macro 
output-block" id="chapter-introduction" data-hasbody="false" 
data-macro-name="include">
 <h1 id="BookInOnePage-Introduction">Introduction</h1>
 
-<div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="include">Apache Camel &#8482; is a versatile open-source 
integration framework based on known <a shape="rect" 
href="enterprise-integration-patterns.html">Enterprise Integration 
Patterns</a>.<p>Camel empowers you to define routing and mediation rules in a 
variety of domain-specific languages, including a Java-based <a shape="rect" 
href="dsl.html">Fluent API</a>, <a shape="rect" href="spring.html">Spring</a> 
or <a shape="rect" href="using-osgi-blueprint-with-camel.html">Blueprint</a> <a 
shape="rect" href="xml-configuration.html">XML Configuration</a> files, and a 
<a shape="rect" href="scala-dsl.html">Scala DSL</a>. This means you get smart 
completion of routing rules in your IDE, whether in a Java, Scala or XML 
editor.</p><p>Apache Camel uses <a shape="rect" href="uris.html">URIs</a> to 
work directly with any kind of <a shape="rect" 
href="transport.html">Transport</a> or messaging model such as <a shape="rect" 
 href="http.html">HTTP</a>, <a shape="rect" href="activemq.html">ActiveMQ</a>, 
<a shape="rect" href="jms.html">JMS</a>, <a shape="rect" 
href="jbi.html">JBI</a>, SCA, <a shape="rect" href="mina.html">MINA</a> or <a 
shape="rect" href="cxf.html">CXF</a>, as well as pluggable <a shape="rect" 
href="components.html">Components</a> and <a shape="rect" 
href="data-format.html">Data Format</a> options. Apache Camel is a small 
library with minimal <a shape="rect" 
href="what-are-the-dependencies.html">dependencies</a> for easy embedding in 
any Java application. Apache Camel lets you work with the same <a shape="rect" 
href="exchange.html">API</a> regardless which kind of <a shape="rect" 
href="transport.html">Transport</a> is used - so learn the API once and you can 
interact with all the <a shape="rect" href="components.html">Components</a> 
provided out-of-box.</p><p>Apache Camel provides support for <a shape="rect" 
href="bean-binding.html">Bean Binding</a> and seamless integration with popular 
fr
 ameworks such as <a shape="rect" href="cdi.html">CDI</a>,&#160;<a shape="rect" 
href="spring.html">Spring</a>, <a shape="rect" 
href="using-osgi-blueprint-with-camel.html">Blueprint</a> and <a shape="rect" 
href="guice.html">Guice</a>. Camel also has extensive support for <a 
shape="rect" href="testing.html">unit testing</a> your routes.</p><p>The 
following projects can leverage Apache Camel as a routing and mediation 
engine:</p><ul><li><a shape="rect" class="external-link" 
href="http://servicemix.apache.org/";>Apache ServiceMix</a> - a popular 
distributed open source ESB and JBI container</li><li><a shape="rect" 
class="external-link" href="http://activemq.apache.org/";>Apache ActiveMQ</a> - 
a mature, widely used open source message broker</li><li><a shape="rect" 
href="http://cxf.apache.org/";>Apache CXF</a> - a smart web services suite 
(JAX-WS and JAX-RS)</li><li><a shape="rect" class="external-link" 
href="http://karaf.apache.org/";>Apache Karaf</a> - a small OSGi based runtime 
in which ap
 plications can be deployed</li><li><a shape="rect" class="external-link" 
href="http://mina.apache.org/";>Apache MINA</a> - a high-performance <a 
shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/New_I/O"; 
rel="nofollow">NIO</a>-driven networking framework</li></ul><p>So don't get the 
hump - try Camel today! <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"></p><div 
class="confluence-information-macro confluence-information-macro-tip conf-macro 
output-block" data-hasbody="true" data-macro-name="tip"><p class="title">Too 
many buzzwords - what exactly is Camel?</p><span class="aui-icon aui-icon-small 
aui-iconfont-approve confluence-information-macro-icon"> </span><div 
class="confluence-information-macro-body"><p>Okay, so the description above is 
technology focused. <br clear="none"> There's a great discussion ab
 out Camel at <a shape="rect" class="external-link" 
href="http://stackoverflow.com/questions/8845186/what-exactly-is-apache-camel"; 
rel="nofollow">Stack Overflow</a>. We suggest you view the post, read the 
comments, and browse the suggested links for more 
details.</p></div></div></div></div>
+<div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="include">Apache Camel &#8482; is a versatile open-source 
integration framework based on known <a shape="rect" 
href="enterprise-integration-patterns.html">Enterprise Integration 
Patterns</a>.<p>Camel empowers you to define routing and mediation rules in a 
variety of domain-specific languages, including a Java-based <a shape="rect" 
href="dsl.html">Fluent API</a>, <a shape="rect" href="spring.html">Spring</a> 
or <a shape="rect" href="using-osgi-blueprint-with-camel.html">Blueprint</a> <a 
shape="rect" href="xml-configuration.html">XML Configuration</a> files, and a 
<a shape="rect" href="scala-dsl.html">Scala DSL</a>. This means you get smart 
completion of routing rules in your IDE, whether in a Java, Scala or XML 
editor.</p><p>Apache Camel uses <a shape="rect" href="uris.html">URIs</a> to 
work directly with any kind of <a shape="rect" 
href="transport.html">Transport</a> or messaging model such as <a shape="rect" 
 href="http.html">HTTP</a>, <a shape="rect" href="activemq.html">ActiveMQ</a>, 
<a shape="rect" href="jms.html">JMS</a>, <a shape="rect" 
href="jbi.html">JBI</a>, SCA, <a shape="rect" href="mina.html">MINA</a> or <a 
shape="rect" href="cxf.html">CXF</a>, as well as pluggable <a shape="rect" 
href="components.html">Components</a> and <a shape="rect" 
href="data-format.html">Data Format</a> options. Apache Camel is a small 
library with minimal <a shape="rect" 
href="what-are-the-dependencies.html">dependencies</a> for easy embedding in 
any Java application. Apache Camel lets you work with the same <a shape="rect" 
href="exchange.html">API</a> regardless which kind of <a shape="rect" 
href="transport.html">Transport</a> is used - so learn the API once and you can 
interact with all the <a shape="rect" href="components.html">Components</a> 
provided out-of-box.</p><p>Apache Camel provides support for <a shape="rect" 
href="bean-binding.html">Bean Binding</a> and seamless integration with popular 
fr
 ameworks such as <a shape="rect" href="cdi.html">CDI</a>,&#160;<a shape="rect" 
href="spring.html">Spring</a>, <a shape="rect" 
href="using-osgi-blueprint-with-camel.html">Blueprint</a> and <a shape="rect" 
href="guice.html">Guice</a>. Camel also has extensive support for <a 
shape="rect" href="testing.html">unit testing</a> your routes.</p><p>The 
following projects can leverage Apache Camel as a routing and mediation 
engine:</p><ul><li><a shape="rect" class="external-link" 
href="http://servicemix.apache.org/";>Apache ServiceMix</a> - a popular 
distributed open source ESB and JBI container</li><li><a shape="rect" 
class="external-link" href="http://activemq.apache.org/";>Apache ActiveMQ</a> - 
a mature, widely used open source message broker</li><li><a shape="rect" 
href="http://cxf.apache.org/";>Apache CXF</a> - a smart web services suite 
(JAX-WS and JAX-RS)</li><li><a shape="rect" class="external-link" 
href="http://karaf.apache.org/";>Apache Karaf</a> - a small OSGi based runtime 
in which ap
 plications can be deployed</li><li><a shape="rect" class="external-link" 
href="http://mina.apache.org/";>Apache MINA</a> - a high-performance <a 
shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/New_I/O"; 
rel="nofollow">NIO</a>-driven networking framework</li></ul><p>So don't get the 
hump - try Camel today! <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"></p><div 
class="confluence-information-macro confluence-information-macro-tip conf-macro 
output-block" data-hasbody="true" data-macro-name="tip"><p class="title">Too 
many buzzwords - what exactly is Camel?</p><span class="aui-icon aui-icon-small 
aui-iconfont-approve confluence-information-macro-icon"> </span><div 
class="confluence-information-macro-body"><p>Okay, so the description above is 
technology focused. <br clear="none"> There's a great discussion ab
 out Camel at <a shape="rect" class="external-link" 
href="http://stackoverflow.com/questions/8845186/what-exactly-is-apache-camel"; 
rel="nofollow">Stack Overflow</a>. We suggest you view the post, read the 
comments, and browse the suggested links for more 
details.</p></div></div></div></div>
 
 
 <div class="chapter page-reset conf-macro output-block conf-macro 
output-block" id="chapter-quickstart" data-hasbody="false" 
data-macro-name="include">
@@ -119,7 +119,7 @@
 <div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="include"><h2 id="BookInOnePage-Walkthroughanotherexample">Walk 
through another example</h2>
 
 <h3 id="BookInOnePage-Introduction.1">Introduction</h3>
-<p>Continuing the walk from our first <a shape="rect" 
href="walk-through-an-example.html">example</a>, we take a closer look at the 
routing and explain a few pointers - so you won't walk into a bear trap, but 
can enjoy an after-hours walk to the local pub for a large beer <img 
class="emoticon emoticon-wink" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/wink.svg";
 data-emoticon-name="wink" alt="(wink)"></p>
+<p>Continuing the walk from our first <a shape="rect" 
href="walk-through-an-example.html">example</a>, we take a closer look at the 
routing and explain a few pointers - so you won't walk into a bear trap, but 
can enjoy an after-hours walk to the local pub for a large beer <img 
class="emoticon emoticon-wink" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/wink.svg";
 data-emoticon-name="wink" alt="(wink)"></p>
 
 <p>First we take a moment to look at the <a shape="rect" 
href="enterprise-integration-patterns.html">Enterprise Integration Patterns</a> 
- the base pattern catalog for integration scenarios. In particular we focus on 
<a shape="rect" href="pipes-and-filters.html">Pipes and filters</a> - a central 
pattern. This is used to route messages through a sequence of processing steps, 
each performing a specific function - much like the Java Servlet Filters. </p>
 
@@ -225,7 +225,7 @@
 2. the output from validateOrder bean is sent as text to the mainframe using 
TCP<br clear="none">
 3. the output from mainframe is sent back as input to the sendConfirmEmai 
bean</p>
 
-<p>What to notice here is that the <code>to</code> is not the end of the route 
(the world <img class="emoticon emoticon-wink" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/wink.svg";
 data-emoticon-name="wink" alt="(wink)">) in this example it's used in the 
middle of the <a shape="rect" href="pipes-and-filters.html">Pipes and 
filters</a>. In fact we can change the <code>bean</code> types to 
<code>to</code> as well:</p>
+<p>What to notice here is that the <code>to</code> is not the end of the route 
(the world <img class="emoticon emoticon-wink" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/wink.svg";
 data-emoticon-name="wink" alt="(wink)">) in this example it's used in the 
middle of the <a shape="rect" href="pipes-and-filters.html">Pipes and 
filters</a>. In fact we can change the <code>bean</code> types to 
<code>to</code> as well:</p>
 <div class="code panel pdl conf-macro output-block" style="border-width: 1px;" 
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent 
pdl">
 <pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java; 
gutter: false; theme: Default" data-theme="Default">
 &lt;route&gt;
@@ -1968,8 +1968,8 @@ public interface Foo {
 
 <p>The best approach when using remoting is to use <a shape="rect" 
href="spring-remoting.html">Spring Remoting</a> which can then use any 
messaging or remoting technology under the covers. When using Camel's 
implementation you can then use any of the Camel <a shape="rect" 
href="components.html">Components</a> along with any of the <a shape="rect" 
href="enterprise-integration-patterns.html">Enterprise Integration 
Patterns</a>.</p>
 
-<p>Another approach is to bind Java beans to Camel endpoints via the <a 
shape="rect" href="bean-integration.html">Bean Integration</a>. For example 
using <a shape="rect" href="pojo-consuming.html">POJO Consuming</a> and <a 
shape="rect" href="pojo-producing.html">POJO Producing</a> you can avoid using 
any Camel APIs to decouple your code both from middleware APIs <em>and</em> 
Camel APIs! <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"></p></div>
-<div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="include"><h2 
id="BookInOnePage-Visualisation">Visualisation</h2><div 
class="confluence-information-macro confluence-information-macro-warning 
conf-macro output-block" data-hasbody="true" data-macro-name="warning"><span 
class="aui-icon aui-icon-small aui-iconfont-error 
confluence-information-macro-icon"> </span><div 
class="confluence-information-macro-body"><p>This functionality is deprecated 
and to be removed in future Camel 
releases.</p></div></div><p>&#160;</p><p>Camel supports the visualisation of 
your <a shape="rect" href="enterprise-integration-patterns.html">Enterprise 
Integration Patterns</a> using the <a shape="rect" class="external-link" 
href="http://graphviz.org"; rel="nofollow">GraphViz</a> DOT files which can 
either be rendered directly via a suitable GraphViz tool or turned into HTML, 
PNG or SVG files via the <a shape="rect" href="camel-maven-plugin.html">Camel 
Maven Plugin</a>.</p><p>Here is a <a
  shape="rect" class="external-link" 
href="http://activemq.apache.org/camel/maven/camel-spring/cameldoc/index.html";>typical
 example</a> of the kind of thing we can generate</p><p><span 
class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" 
src="book-in-one-page.data/org.apache.camel.example.docs.ContentBasedRouteRoute.png"
 
data-image-src="/confluence/download/attachments/64021/org.apache.camel.example.docs.ContentBasedRouteRoute.png?version=1&amp;modificationDate=1229506014000&amp;api=v2"
 data-unresolved-comment-count="0" data-linked-resource-id="9437" 
data-linked-resource-version="1" data-linked-resource-type="attachment" 
data-linked-resource-default-alias="org.apache.camel.example.docs.ContentBasedRouteRoute.png"
 data-base-url="https://cwiki.apache.org/confluence"; 
data-linked-resource-content-type="image/png" 
data-linked-resource-container-id="64021" 
data-linked-resource-container-version="18"></span></p><p>If you click on <a 
shape="rect" class="external-li
 nk" 
href="http://activemq.apache.org/camel/maven/examples/camel-example-docs/cameldoc/main/routes.html";>the
 actual generated html</a>you will see that you can navigate from an EIP node 
to its pattern page, along with getting hover-over tool tips ec.</p><h3 
id="BookInOnePage-Howtogenerate">How to generate</h3><p>See <a shape="rect" 
href="camel-dot-maven-goal.html">Camel Dot Maven Goal</a> or the other maven 
goals <a shape="rect" href="camel-maven-plugin.html">Camel Maven 
Plugin</a></p><h3 id="BookInOnePage-ForOSXusers">For OS X users</h3><p>If you 
are using OS X then you can open the DOT file using <a shape="rect" 
class="external-link" href="http://www.pixelglow.com/graphviz/"; 
rel="nofollow">graphviz</a> which will then automatically re-render if it 
changes, so you end up with a real time graphical representation of the topic 
and queue hierarchies!</p><p>Also if you want to edit the layout a little 
before adding it to a wiki to distribute to your team, open the DOT file with 
<a shape
 ="rect" class="external-link" 
href="http://www.omnigroup.com/applications/omnigraffle/"; 
rel="nofollow">OmniGraffle</a> then just edit away <img class="emoticon 
emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"></p></div>
+<p>Another approach is to bind Java beans to Camel endpoints via the <a 
shape="rect" href="bean-integration.html">Bean Integration</a>. For example 
using <a shape="rect" href="pojo-consuming.html">POJO Consuming</a> and <a 
shape="rect" href="pojo-producing.html">POJO Producing</a> you can avoid using 
any Camel APIs to decouple your code both from middleware APIs <em>and</em> 
Camel APIs! <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"></p></div>
+<div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="include"><h2 
id="BookInOnePage-Visualisation">Visualisation</h2><div 
class="confluence-information-macro confluence-information-macro-warning 
conf-macro output-block" data-hasbody="true" data-macro-name="warning"><span 
class="aui-icon aui-icon-small aui-iconfont-error 
confluence-information-macro-icon"> </span><div 
class="confluence-information-macro-body"><p>This functionality is deprecated 
and to be removed in future Camel 
releases.</p></div></div><p>&#160;</p><p>Camel supports the visualisation of 
your <a shape="rect" href="enterprise-integration-patterns.html">Enterprise 
Integration Patterns</a> using the <a shape="rect" class="external-link" 
href="http://graphviz.org"; rel="nofollow">GraphViz</a> DOT files which can 
either be rendered directly via a suitable GraphViz tool or turned into HTML, 
PNG or SVG files via the <a shape="rect" href="camel-maven-plugin.html">Camel 
Maven Plugin</a>.</p><p>Here is a <a
  shape="rect" class="external-link" 
href="http://activemq.apache.org/camel/maven/camel-spring/cameldoc/index.html";>typical
 example</a> of the kind of thing we can generate</p><p><span 
class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" 
src="book-in-one-page.data/org.apache.camel.example.docs.ContentBasedRouteRoute.png"
 
data-image-src="/confluence/download/attachments/64021/org.apache.camel.example.docs.ContentBasedRouteRoute.png?version=1&amp;modificationDate=1229506014000&amp;api=v2"
 data-unresolved-comment-count="0" data-linked-resource-id="9437" 
data-linked-resource-version="1" data-linked-resource-type="attachment" 
data-linked-resource-default-alias="org.apache.camel.example.docs.ContentBasedRouteRoute.png"
 data-base-url="https://cwiki.apache.org/confluence"; 
data-linked-resource-content-type="image/png" 
data-linked-resource-container-id="64021" 
data-linked-resource-container-version="18"></span></p><p>If you click on <a 
shape="rect" class="external-li
 nk" 
href="http://activemq.apache.org/camel/maven/examples/camel-example-docs/cameldoc/main/routes.html";>the
 actual generated html</a>you will see that you can navigate from an EIP node 
to its pattern page, along with getting hover-over tool tips ec.</p><h3 
id="BookInOnePage-Howtogenerate">How to generate</h3><p>See <a shape="rect" 
href="camel-dot-maven-goal.html">Camel Dot Maven Goal</a> or the other maven 
goals <a shape="rect" href="camel-maven-plugin.html">Camel Maven 
Plugin</a></p><h3 id="BookInOnePage-ForOSXusers">For OS X users</h3><p>If you 
are using OS X then you can open the DOT file using <a shape="rect" 
class="external-link" href="http://www.pixelglow.com/graphviz/"; 
rel="nofollow">graphviz</a> which will then automatically re-render if it 
changes, so you end up with a real time graphical representation of the topic 
and queue hierarchies!</p><p>Also if you want to edit the layout a little 
before adding it to a wiki to distribute to your team, open the DOT file with 
<a shape
 ="rect" class="external-link" 
href="http://www.omnigroup.com/applications/omnigraffle/"; 
rel="nofollow">OmniGraffle</a> then just edit away <img class="emoticon 
emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"></p></div>
 <div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="include"><h2 
id="BookInOnePage-BusinessActivityMonitoring">Business Activity Monitoring </h2>
 
 <p>The <strong>Camel BAM</strong> module provides a Business Activity 
Monitoring (BAM) framework for testing business processes across multiple 
message exchanges on different <a shape="rect" 
href="endpoint.html">Endpoint</a> instances.</p>
@@ -2043,7 +2043,7 @@ resultEndpoint.assertIsSatisfied();
 </plain-text-body><p>You can also use between to set a lower bound. For 
example suppose that it should be between 1-4 
seconds:</p><plain-text-body>mock.message(1).arrives().between(1, 
4).seconds().afterPrevious();
 </plain-text-body><p>You can also set the expectation on all messages, for 
example to say that the gap between them should be at most 1 
second:</p><plain-text-body>mock.allMessages().arrives().noLaterThan(1).seconds().beforeNext();
 </plain-text-body><parameter ac:name="title">time 
units</parameter><rich-text-body><p>In the example above we use 
<code>seconds</code> as the time unit, but Camel offers 
<code>milliseconds</code>, and <code>minutes</code> as 
well.</p></rich-text-body><p><parameter ac:name=""><a shape="rect" 
href="endpoint-see-also.html">Endpoint See Also</a></parameter></p><ul><li><a 
shape="rect" href="spring-testing.html">Spring Testing</a></li><li><a 
shape="rect" href="testing.html">Testing</a></li></ul></div>
-<div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="include"><h2 id="BookInOnePage-Testing">Testing</h2><p>Testing 
is a crucial activity in any piece of software development or integration. 
Typically Camel Riders use various different <a shape="rect" 
href="components.html">technologies</a> wired together in a variety of <a 
shape="rect" href="enterprise-integration-patterns.html">patterns</a> with 
different <a shape="rect" href="languages.html">expression languages</a> 
together with different forms of <a shape="rect" 
href="bean-integration.html">Bean Integration</a> and <a shape="rect" 
href="dependency-injection.html">Dependency Injection</a> so its very easy for 
things to go wrong! <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"> . Testing is the crucial weapon to 
ensure that things work as you would e
 xpect.</p><p>Camel is a Java library so you can easily wire up tests in 
whatever unit testing framework you use (JUnit 3.x (deprecated), 4.x, or 
TestNG). However the Camel project has tried to make the testing of Camel as 
easy and powerful as possible so we have introduced the following 
features.</p><h3 id="BookInOnePage-TestingMechanisms">Testing 
Mechanisms</h3><p>The following mechanisms are supported:</p><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Component</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><a shape="rect" 
href="camel-test.html">Camel Test</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>camel-test</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Is a standalone Java library letting you 
easily create
  Camel test cases using a single Java class for all your configuration and 
routing without using <a shape="rect" href="cdi.html">CDI</a>, <a shape="rect" 
href="spring.html">Spring</a> or <a shape="rect" href="guice.html">Guice</a> 
for <a shape="rect" href="dependency-injection.html">Dependency 
Injection</a>&#160;which does not require an in-depth knowledge of Spring + 
Spring Test or Guice. &#160;Supports JUnit 3.x (deprecated) and JUnit 4.x based 
tests.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><a 
shape="rect" href="cdi-testing.html">CDI Testing</a></td><td colspan="1" 
rowspan="1" class="confluenceTd"><code>camel-test-cdi</code></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Provides a JUnit 4 runner that 
bootstraps a test environment using CDI so that you don't have to be familiar 
with any CDI testing frameworks and can concentrate on the testing logic of 
your Camel CDI applications. Testing frameworks like&#160;<a shape="rect" 
class="external-link"
  href="http://arquillian.org/"; rel="nofollow">Arquillian</a>&#160;or&#160;<a 
shape="rect" class="external-link" 
href="https://ops4j1.jira.com/wiki/display/PAXEXAM4"; rel="nofollow">PAX 
Exam</a>, can be used for more advanced test cases, where you need to configure 
your system under test in a very fine-grained way or target specific CDI 
containers.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><a shape="rect" href="spring-testing.html">Spring 
Testing</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>camel-test-spring</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Supports JUnit 3.x (deprecated) or JUnit 
4.x based tests that bootstrap a test environment using Spring without needing 
to be familiar with Spring Test. The plain JUnit 3.x/4.x based tests work very 
similar to the test support classes in 
<strong><code>camel-test</code></strong>.</p><p>Also supports Spring Test based 
tests that use the declarative style of test con
 figuration and injection common in Spring Test. The Spring Test based tests 
provide feature parity with the plain JUnit 3.x/4.x based testing 
approach.</p><p><strong>Note</strong>: 
<strong><code>camel-test-spring</code></strong> is a new component from 
<strong>Camel 2.10</strong>. For older Camel release use 
<strong><code>camel-test</code></strong> which has built-in <a shape="rect" 
href="spring-testing.html">Spring Testing</a>.</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><a shape="rect" 
href="blueprint-testing.html">Blueprint Testing</a></p></td><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p><code>camel-test-blueprint</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> 
Provides the ability to do unit testing on blueprint 
configurations</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><a shape="rect" href="guice.html">Guice</a></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><co
 de>camel-guice</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><span style="color: 
rgb(255,0,0);"><strong>Deprecated</strong></span></p><p>Uses <a shape="rect" 
href="guice.html">Guice</a> to dependency inject your test 
classes</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Camel TestNG</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>camel-testng</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><span style="color: 
rgb(255,0,0);"><strong>Deprecated</strong></span></p><p>Supports plain TestNG 
based tests&#160;with or without <a shape="rect" 
href="cdi.html">CDI</a>,&#160;<a shape="rect" 
href="spring.html">Spring</a>&#160;or&#160;<a shape="rect" 
href="guice.html">Guice</a>&#160;for&#160;<a shape="rect" 
href="dependency-injection.html">Dependency Injection</a>&#160;which does not 
require an in-depth knowledge of CDI, Spring + Spring Test or Guice. 
&#160;</p><p>From <strong>Camel 2.10</strong>: this component supp
 orts Spring Test&#160;based tests that use the declarative style of test 
configuration and injection common in Spring Test and described in more detail 
under <a shape="rect" href="spring-testing.html">Spring 
Testing</a>.</p></td></tr></tbody></table></div><p>In all approaches the test 
classes look pretty much the same in that they all reuse the <a shape="rect" 
href="bean-integration.html">Camel binding and injection 
annotations</a>.</p><h4 id="BookInOnePage-CamelTestExample">Camel Test 
Example</h4><p>Here is the <a shape="rect" href="camel-test.html">Camel 
Test</a> <a shape="rect" class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterTest.java";>example</a>:<plain-text-body>{snippet:lang=java|id=example|url=camel/trunk/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterTest.java}</plain-text-body>Notice
 how it derives from the Camel helper class <strong><code>CamelTestSupp
 ort</code></strong> but has no CDI, Spring or Guice dependency injection 
configuration but instead overrides the 
<strong><code>createRouteBuilder()</code></strong> method.</p><h4 
id="BookInOnePage-CDITestExample">CDI Test Example</h4><p>Here is the <a 
shape="rect" href="cdi-testing.html">CDI Testing</a> <a shape="rect" 
class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-test-cdi/src/test/java/org/apache/camel/test/cdi/FilterTest.java";>example</a>:<plain-text-body>{snippet:lang=java|id=example|url=camel/trunk/components/camel-test-cdi/src/test/java/org/apache/camel/test/cdi/FilterTest.java}</plain-text-body>You
 can find more testing patterns illustrated in the 
<strong><code>camel-example-cdi-test</code></strong> example&#160;and the test 
classes that come with it.</p><h4 
id="BookInOnePage-SpringTestwithXMLConfigExample">Spring Test with XML Config 
Example</h4><p>Here is the <a shape="rect" href="spring-testing.html">Spring 
Testing</a> <a shape="re
 ct" class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/patterns/FilterTest.java";>example
 using XML 
Config</a>:<plain-text-body>{snippet:lang=java|id=example|url=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/patterns/FilterTest.java}</plain-text-body>Notice
 that we use <strong><code>@DirtiesContext</code></strong> on the test methods 
to force <a shape="rect" href="spring-testing.html">Spring Testing</a> to 
automatically reload the <code><a shape="rect" 
href="camelcontext.html">CamelContext</a></code> after each test method - this 
ensures that the tests don't clash with each other, e.g., one test method 
sending to an endpoint that is then reused in another test method.</p><p>Also 
note the use of <strong><code>@ContextConfiguration</code></strong> to indicate 
that by default we should look for the <a shape="rect" class="external-link" 
href="http://svn.apache.org/repos/asf/came
 
l/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/patterns/FilterTest-context.xml"><code>FilterTest-context.xml</code>
 on the classpath</a> to configure the test case which looks like 
this:<plain-text-body>{snippet:lang=xml|id=example|url=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/patterns/FilterTest-context.xml}</plain-text-body></p><h4
 id="BookInOnePage-SpringTestwithJavaConfigExample">Spring Test with Java 
Config Example</h4><p>Here is the <a shape="rect" 
href="spring-testing.html">Spring Testing</a> <a shape="rect" 
class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/patterns/FilterTest.java";>example
 using Java Config</a>.</p><p>For more information see <a shape="rect" 
href="spring-java-config.html">Spring Java 
Config</a>.<plain-text-body>{snippet:lang=java|id=example|url=camel/trunk/components/camel-spring-javaconfig
 
/src/test/java/org/apache/camel/spring/javaconfig/patterns/FilterTest.java}</plain-text-body>This
 is similar to the XML Config example above except that there is no XML file 
and instead the nested <strong><code>ContextConfig</code></strong> class does 
all of the configuration; so your entire test case is contained in a single 
Java class. We currently have to reference by class name this class in the 
<strong><code>@ContextConfiguration</code></strong> which is a bit ugly. Please 
vote for <a shape="rect" class="external-link" 
href="http://jira.springframework.org/browse/SJC-238"; 
rel="nofollow">SJC-238</a> to address this and make Spring Test work more 
cleanly with Spring JavaConfig.</p><p>Its totally optional but for 
the&#160;<strong><code>ContextConfig</code></strong> implementation we derive 
from <strong><code>SingleRouteCamelConfiguration</code></strong> which is a 
helper Spring Java Config class which will configure the 
<strong><code>CamelContext</code></strong> for us and then re
 gister the <strong><code>RouteBuilder</code></strong> we create.</p><p>Since 
<strong>Camel 2.11.0</strong> you can use the 
<strong><code>CamelSpringJUnit4ClassRunner</code></strong> with 
<strong><code>CamelSpringDelegatingTestContextLoader</code></strong> like <a 
shape="rect" class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/test/CamelSpringDelegatingTestContextLoaderTest.java";>example
 using Java Config with 
<code>CamelSpringJUnit4ClassRunner</code></a>:<plain-text-body>{snippet:lang=java|id=example|url=camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/test/CamelSpringDelegatingTestContextLoaderTest.java}</plain-text-body></p><h4
 
id="BookInOnePage-SpringTestwithXMLConfigandDeclarativeConfigurationExample">Spring
 Test with XML Config and Declarative Configuration Example</h4><p>Here is a 
Camel test support enhanced&#160;<a shape="rect
 " href="spring-testing.html">Spring Testing</a>&#160;<a shape="rect" 
class="external-link" 
href="https://svn.apache.org/repos/asf/camel/trunk/components/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerPlainTest.java";>example
 using XML Config and pure Spring Test based configuration of the Camel 
Context</a>:<plain-text-body>{snippet:lang=java|id=e1|url=camel/trunk/components/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerPlainTest.java}</plain-text-body>Notice
 how a custom test runner is used with 
the&#160;<strong><code>@RunWith</code></strong>&#160;annotation to support the 
features of&#160;<strong><code>CamelTestSupport</code></strong>&#160;through 
annotations on the test class. See&#160;<a shape="rect" 
href="spring-testing.html">Spring Testing</a>&#160;for a list of annotations 
you can use in your tests.</p><h4 id="BookInOnePage-BlueprintTest">Blueprint 
Test</h4><p>Here is the <a shape="rect" href="
 blueprint-testing.html">Blueprint Testing</a> <a shape="rect" 
class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DebugBlueprintTest.java";>example
 using XML 
Config</a>:<plain-text-body>{snippet:lang=java|id=example|url=camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DebugBlueprintTest.java}</plain-text-body>Also
 notice the use of <strong><code>getBlueprintDescriptors</code></strong> to 
indicate that by default we should look for the <a shape="rect" 
class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/camelContext.xml";><code>camelContext.xml</code>
 in the package</a> to configure the test case which looks like 
this:<plain-text-body>{snippet:lang=xml|id=example|url=camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/tes
 t/blueprint/camelContext.xml}</plain-text-body></p><h3 
id="BookInOnePage-TestingEndpoints">Testing Endpoints</h3><p>Camel provides a 
number of endpoints which can make testing easier.</p><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><a shape="rect" 
href="dataset.html">DataSet</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>For load &amp; soak testing this endpoint provides a 
way to create huge numbers of messages for sending to <a shape="rect" 
href="components.html">Components</a> and asserting that they are consumed 
correctly</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><a shape="rect" href="mock.html">Mock</a></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>For testing routes and 
mediation rules using mocks and allo
 wing assertions to be added to an endpoint</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><a shape="rect" 
href="test.html">Test</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Creates a <a shape="rect" href="mock.html">Mock</a> 
endpoint which expects to receive all the message bodies that could be polled 
from the given underlying endpoint</p></td></tr></tbody></table></div><p>The 
main endpoint is the <a shape="rect" href="mock.html">Mock</a> endpoint which 
allows expectations to be added to different endpoints; you can then run your 
tests and assert that your expectations are met at the end.</p><h3 
id="BookInOnePage-Stubbingoutphysicaltransporttechnologies">Stubbing out 
physical transport technologies</h3><p>If you wish to test out a route but want 
to avoid actually using a real physical transport (for example to unit test a 
transformation route rather than performing a full integration test) then the 
following endpoints can be useful.</p><div c
 lass="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><a shape="rect" 
href="direct.html">Direct</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Direct invocation of the consumer from the producer so 
that single threaded (non-SEDA) in VM invocation is performed which can be 
useful to mock out physical transports</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><a shape="rect" 
href="seda.html">SEDA</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Delivers messages asynchronously to consumers via a <a 
shape="rect" class="external-link" 
href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/BlockingQueue.html";
 rel="nofollow">java.util.concurrent.BlockingQueue</a> which is good for 
testing asynchronous transports</p></td></tr
 ><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" 
 >href="stub.html">Stub</a></p></td><td colspan="1" rowspan="1" 
 >class="confluenceTd"><p>Works like <a shape="rect" href="seda.html">SEDA</a> 
 >but does not validate the endpoint URI, which makes stubbing much 
 >easier.</p></td></tr></tbody></table></div><h3 
 >id="BookInOnePage-Testingexistingroutes">Testing existing routes</h3><p>Camel 
 >provides some features to aid during testing of existing routes where you 
 >cannot or will not use <a shape="rect" href="mock.html">Mock</a> etc. For 
 >example you may have a production ready route which you want to test with 
 >some 3rd party API which sends messages into this route.</p><div 
 >class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
 >rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" 
 >class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
 >rowspan="1" class="confluenceTd"><p><a shape="rect" 
 >href="notifybuilder.html">Notify
 Builder</a></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Allows 
you to be notified when a certain condition has occurred. For example when the 
route has completed five messages. You can build complex expressions to match 
your criteria when to be notified.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><a shape="rect" 
href="advicewith.html">AdviceWith</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Allows you to <strong>advice</strong> or 
<strong>enhance</strong> an existing route using a <a shape="rect" 
href="routebuilder.html">RouteBuilder</a> style. For example you can add 
interceptors to intercept sending outgoing messages to assert those messages 
are as expected.</p></td></tr></tbody></table></div></div>
+<div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="include"><h2 id="BookInOnePage-Testing">Testing</h2><p>Testing 
is a crucial activity in any piece of software development or integration. 
Typically Camel Riders use various different <a shape="rect" 
href="components.html">technologies</a> wired together in a variety of <a 
shape="rect" href="enterprise-integration-patterns.html">patterns</a> with 
different <a shape="rect" href="languages.html">expression languages</a> 
together with different forms of <a shape="rect" 
href="bean-integration.html">Bean Integration</a> and <a shape="rect" 
href="dependency-injection.html">Dependency Injection</a> so its very easy for 
things to go wrong! <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"> . Testing is the crucial weapon to 
ensure that things work as you would e
 xpect.</p><p>Camel is a Java library so you can easily wire up tests in 
whatever unit testing framework you use (JUnit 3.x (deprecated), 4.x, or 
TestNG). However the Camel project has tried to make the testing of Camel as 
easy and powerful as possible so we have introduced the following 
features.</p><h3 id="BookInOnePage-TestingMechanisms">Testing 
Mechanisms</h3><p>The following mechanisms are supported:</p><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Component</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><a shape="rect" 
href="camel-test.html">Camel Test</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>camel-test</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Is a standalone Java library letting you 
easily create
  Camel test cases using a single Java class for all your configuration and 
routing without using <a shape="rect" href="cdi.html">CDI</a>, <a shape="rect" 
href="spring.html">Spring</a> or <a shape="rect" href="guice.html">Guice</a> 
for <a shape="rect" href="dependency-injection.html">Dependency 
Injection</a>&#160;which does not require an in-depth knowledge of Spring + 
Spring Test or Guice. &#160;Supports JUnit 3.x (deprecated) and JUnit 4.x based 
tests.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><a 
shape="rect" href="cdi-testing.html">CDI Testing</a></td><td colspan="1" 
rowspan="1" class="confluenceTd"><code>camel-test-cdi</code></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Provides a JUnit 4 runner that 
bootstraps a test environment using CDI so that you don't have to be familiar 
with any CDI testing frameworks and can concentrate on the testing logic of 
your Camel CDI applications. Testing frameworks like&#160;<a shape="rect" 
class="external-link"
  href="http://arquillian.org/"; rel="nofollow">Arquillian</a>&#160;or&#160;<a 
shape="rect" class="external-link" 
href="https://ops4j1.jira.com/wiki/display/PAXEXAM4"; rel="nofollow">PAX 
Exam</a>, can be used for more advanced test cases, where you need to configure 
your system under test in a very fine-grained way or target specific CDI 
containers.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><a shape="rect" href="spring-testing.html">Spring 
Testing</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>camel-test-spring</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Supports JUnit 3.x (deprecated) or JUnit 
4.x based tests that bootstrap a test environment using Spring without needing 
to be familiar with Spring Test. The plain JUnit 3.x/4.x based tests work very 
similar to the test support classes in 
<strong><code>camel-test</code></strong>.</p><p>Also supports Spring Test based 
tests that use the declarative style of test con
 figuration and injection common in Spring Test. The Spring Test based tests 
provide feature parity with the plain JUnit 3.x/4.x based testing 
approach.</p><p><strong>Note</strong>: 
<strong><code>camel-test-spring</code></strong> is a new component from 
<strong>Camel 2.10</strong>. For older Camel release use 
<strong><code>camel-test</code></strong> which has built-in <a shape="rect" 
href="spring-testing.html">Spring Testing</a>.</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><a shape="rect" 
href="blueprint-testing.html">Blueprint Testing</a></p></td><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p><code>camel-test-blueprint</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> 
Provides the ability to do unit testing on blueprint 
configurations</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><a shape="rect" href="guice.html">Guice</a></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><co
 de>camel-guice</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><span style="color: 
rgb(255,0,0);"><strong>Deprecated</strong></span></p><p>Uses <a shape="rect" 
href="guice.html">Guice</a> to dependency inject your test 
classes</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Camel TestNG</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>camel-testng</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><span style="color: 
rgb(255,0,0);"><strong>Deprecated</strong></span></p><p>Supports plain TestNG 
based tests&#160;with or without <a shape="rect" 
href="cdi.html">CDI</a>,&#160;<a shape="rect" 
href="spring.html">Spring</a>&#160;or&#160;<a shape="rect" 
href="guice.html">Guice</a>&#160;for&#160;<a shape="rect" 
href="dependency-injection.html">Dependency Injection</a>&#160;which does not 
require an in-depth knowledge of CDI, Spring + Spring Test or Guice. 
&#160;</p><p>From <strong>Camel 2.10</strong>: this component supp
 orts Spring Test&#160;based tests that use the declarative style of test 
configuration and injection common in Spring Test and described in more detail 
under <a shape="rect" href="spring-testing.html">Spring 
Testing</a>.</p></td></tr></tbody></table></div><p>In all approaches the test 
classes look pretty much the same in that they all reuse the <a shape="rect" 
href="bean-integration.html">Camel binding and injection 
annotations</a>.</p><h4 id="BookInOnePage-CamelTestExample">Camel Test 
Example</h4><p>Here is the <a shape="rect" href="camel-test.html">Camel 
Test</a> <a shape="rect" class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterTest.java";>example</a>:<plain-text-body>{snippet:lang=java|id=example|url=camel/trunk/components/camel-test/src/test/java/org/apache/camel/test/patterns/FilterTest.java}</plain-text-body>Notice
 how it derives from the Camel helper class <strong><code>CamelTestSupp
 ort</code></strong> but has no CDI, Spring or Guice dependency injection 
configuration but instead overrides the 
<strong><code>createRouteBuilder()</code></strong> method.</p><h4 
id="BookInOnePage-CDITestExample">CDI Test Example</h4><p>Here is the <a 
shape="rect" href="cdi-testing.html">CDI Testing</a> <a shape="rect" 
class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-test-cdi/src/test/java/org/apache/camel/test/cdi/FilterTest.java";>example</a>:<plain-text-body>{snippet:lang=java|id=example|url=camel/trunk/components/camel-test-cdi/src/test/java/org/apache/camel/test/cdi/FilterTest.java}</plain-text-body>You
 can find more testing patterns illustrated in the 
<strong><code>camel-example-cdi-test</code></strong> example&#160;and the test 
classes that come with it.</p><h4 
id="BookInOnePage-SpringTestwithXMLConfigExample">Spring Test with XML Config 
Example</h4><p>Here is the <a shape="rect" href="spring-testing.html">Spring 
Testing</a> <a shape="re
 ct" class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/patterns/FilterTest.java";>example
 using XML 
Config</a>:<plain-text-body>{snippet:lang=java|id=example|url=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/patterns/FilterTest.java}</plain-text-body>Notice
 that we use <strong><code>@DirtiesContext</code></strong> on the test methods 
to force <a shape="rect" href="spring-testing.html">Spring Testing</a> to 
automatically reload the <code><a shape="rect" 
href="camelcontext.html">CamelContext</a></code> after each test method - this 
ensures that the tests don't clash with each other, e.g., one test method 
sending to an endpoint that is then reused in another test method.</p><p>Also 
note the use of <strong><code>@ContextConfiguration</code></strong> to indicate 
that by default we should look for the <a shape="rect" class="external-link" 
href="http://svn.apache.org/repos/asf/came
 
l/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/patterns/FilterTest-context.xml"><code>FilterTest-context.xml</code>
 on the classpath</a> to configure the test case which looks like 
this:<plain-text-body>{snippet:lang=xml|id=example|url=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/patterns/FilterTest-context.xml}</plain-text-body></p><h4
 id="BookInOnePage-SpringTestwithJavaConfigExample">Spring Test with Java 
Config Example</h4><p>Here is the <a shape="rect" 
href="spring-testing.html">Spring Testing</a> <a shape="rect" 
class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/patterns/FilterTest.java";>example
 using Java Config</a>.</p><p>For more information see <a shape="rect" 
href="spring-java-config.html">Spring Java 
Config</a>.<plain-text-body>{snippet:lang=java|id=example|url=camel/trunk/components/camel-spring-javaconfig
 
/src/test/java/org/apache/camel/spring/javaconfig/patterns/FilterTest.java}</plain-text-body>This
 is similar to the XML Config example above except that there is no XML file 
and instead the nested <strong><code>ContextConfig</code></strong> class does 
all of the configuration; so your entire test case is contained in a single 
Java class. We currently have to reference by class name this class in the 
<strong><code>@ContextConfiguration</code></strong> which is a bit ugly. Please 
vote for <a shape="rect" class="external-link" 
href="http://jira.springframework.org/browse/SJC-238"; 
rel="nofollow">SJC-238</a> to address this and make Spring Test work more 
cleanly with Spring JavaConfig.</p><p>Its totally optional but for 
the&#160;<strong><code>ContextConfig</code></strong> implementation we derive 
from <strong><code>SingleRouteCamelConfiguration</code></strong> which is a 
helper Spring Java Config class which will configure the 
<strong><code>CamelContext</code></strong> for us and then re
 gister the <strong><code>RouteBuilder</code></strong> we create.</p><p>Since 
<strong>Camel 2.11.0</strong> you can use the 
<strong><code>CamelSpringJUnit4ClassRunner</code></strong> with 
<strong><code>CamelSpringDelegatingTestContextLoader</code></strong> like <a 
shape="rect" class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/test/CamelSpringDelegatingTestContextLoaderTest.java";>example
 using Java Config with 
<code>CamelSpringJUnit4ClassRunner</code></a>:<plain-text-body>{snippet:lang=java|id=example|url=camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/test/CamelSpringDelegatingTestContextLoaderTest.java}</plain-text-body></p><h4
 
id="BookInOnePage-SpringTestwithXMLConfigandDeclarativeConfigurationExample">Spring
 Test with XML Config and Declarative Configuration Example</h4><p>Here is a 
Camel test support enhanced&#160;<a shape="rect
 " href="spring-testing.html">Spring Testing</a>&#160;<a shape="rect" 
class="external-link" 
href="https://svn.apache.org/repos/asf/camel/trunk/components/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerPlainTest.java";>example
 using XML Config and pure Spring Test based configuration of the Camel 
Context</a>:<plain-text-body>{snippet:lang=java|id=e1|url=camel/trunk/components/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringJUnit4ClassRunnerPlainTest.java}</plain-text-body>Notice
 how a custom test runner is used with 
the&#160;<strong><code>@RunWith</code></strong>&#160;annotation to support the 
features of&#160;<strong><code>CamelTestSupport</code></strong>&#160;through 
annotations on the test class. See&#160;<a shape="rect" 
href="spring-testing.html">Spring Testing</a>&#160;for a list of annotations 
you can use in your tests.</p><h4 id="BookInOnePage-BlueprintTest">Blueprint 
Test</h4><p>Here is the <a shape="rect" href="
 blueprint-testing.html">Blueprint Testing</a> <a shape="rect" 
class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DebugBlueprintTest.java";>example
 using XML 
Config</a>:<plain-text-body>{snippet:lang=java|id=example|url=camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DebugBlueprintTest.java}</plain-text-body>Also
 notice the use of <strong><code>getBlueprintDescriptors</code></strong> to 
indicate that by default we should look for the <a shape="rect" 
class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/camelContext.xml";><code>camelContext.xml</code>
 in the package</a> to configure the test case which looks like 
this:<plain-text-body>{snippet:lang=xml|id=example|url=camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/tes
 t/blueprint/camelContext.xml}</plain-text-body></p><h3 
id="BookInOnePage-TestingEndpoints">Testing Endpoints</h3><p>Camel provides a 
number of endpoints which can make testing easier.</p><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><a shape="rect" 
href="dataset.html">DataSet</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>For load &amp; soak testing this endpoint provides a 
way to create huge numbers of messages for sending to <a shape="rect" 
href="components.html">Components</a> and asserting that they are consumed 
correctly</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><a shape="rect" href="mock.html">Mock</a></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>For testing routes and 
mediation rules using mocks and allo
 wing assertions to be added to an endpoint</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><a shape="rect" 
href="test.html">Test</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Creates a <a shape="rect" href="mock.html">Mock</a> 
endpoint which expects to receive all the message bodies that could be polled 
from the given underlying endpoint</p></td></tr></tbody></table></div><p>The 
main endpoint is the <a shape="rect" href="mock.html">Mock</a> endpoint which 
allows expectations to be added to different endpoints; you can then run your 
tests and assert that your expectations are met at the end.</p><h3 
id="BookInOnePage-Stubbingoutphysicaltransporttechnologies">Stubbing out 
physical transport technologies</h3><p>If you wish to test out a route but want 
to avoid actually using a real physical transport (for example to unit test a 
transformation route rather than performing a full integration test) then the 
following endpoints can be useful.</p><div c
 lass="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><a shape="rect" 
href="direct.html">Direct</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Direct invocation of the consumer from the producer so 
that single threaded (non-SEDA) in VM invocation is performed which can be 
useful to mock out physical transports</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><a shape="rect" 
href="seda.html">SEDA</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Delivers messages asynchronously to consumers via a <a 
shape="rect" class="external-link" 
href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/BlockingQueue.html";
 rel="nofollow">java.util.concurrent.BlockingQueue</a> which is good for 
testing asynchronous transports</p></td></tr
 ><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" 
 >href="stub.html">Stub</a></p></td><td colspan="1" rowspan="1" 
 >class="confluenceTd"><p>Works like <a shape="rect" href="seda.html">SEDA</a> 
 >but does not validate the endpoint URI, which makes stubbing much 
 >easier.</p></td></tr></tbody></table></div><h3 
 >id="BookInOnePage-Testingexistingroutes">Testing existing routes</h3><p>Camel 
 >provides some features to aid during testing of existing routes where you 
 >cannot or will not use <a shape="rect" href="mock.html">Mock</a> etc. For 
 >example you may have a production ready route which you want to test with 
 >some 3rd party API which sends messages into this route.</p><div 
 >class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
 >rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" 
 >class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
 >rowspan="1" class="confluenceTd"><p><a shape="rect" 
 >href="notifybuilder.html">Notify
 Builder</a></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Allows 
you to be notified when a certain condition has occurred. For example when the 
route has completed five messages. You can build complex expressions to match 
your criteria when to be notified.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><a shape="rect" 
href="advicewith.html">AdviceWith</a></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Allows you to <strong>advice</strong> or 
<strong>enhance</strong> an existing route using a <a shape="rect" 
href="routebuilder.html">RouteBuilder</a> style. For example you can add 
interceptors to intercept sending outgoing messages to assert those messages 
are as expected.</p></td></tr></tbody></table></div></div>
 <div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="include"><h2 id="BookInOnePage-CamelTest">Camel Test</h2><p>As 
a simple alternative to using <a shape="rect" href="cdi-testing.html">CDI 
Testing</a>,&#160;<a shape="rect" href="spring-testing.html">Spring Testing</a> 
or <a shape="rect" href="guice.html">Guice</a> the <strong>camel-test</strong> 
module was introduced so you can perform powerful <a shape="rect" 
href="testing.html">Testing</a> of your <a shape="rect" 
href="enterprise-integration-patterns.html">Enterprise Integration Patterns</a> 
easily.</p><parameter ac:name="tile">JUnit or 
TestNG</parameter><rich-text-body><p>The 
<strong><code>camel-test</code></strong> JAR is using JUnit. There is an 
alternative <strong><code>camel-testng</code></strong> JAR (from <strong>Camel 
2.8</strong>) using the <a shape="rect" class="external-link" 
href="http://testng.org/doc/index.html"; rel="nofollow">TestNG</a> test 
framework.</p></rich-text-body><h3 id="BookInOnePage
 -Addingtoyourpom.xml">Adding to your&#160;<code>pom.xml</code></h3><p>To get 
started using Camel Test you will need to add an entry to your 
<strong><code>pom.xml</code></strong>:</p><h4 
id="BookInOnePage-JUnit">JUnit</h4><parameter 
ac:name="">xml</parameter><plain-text-body>&lt;dependency&gt;
   &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
   &lt;artifactId&gt;camel-test&lt;/artifactId&gt;
@@ -2314,7 +2314,7 @@ public class MyModule extends CamelModul
 </pre>
 </div></div><h3 id="BookInOnePage-SeeAlso.3">See Also</h3><ul><li><a 
shape="rect" href="mock.html">Mock</a> for details of mock endpoint testing (as 
opposed to template based stubs).</li></ul></div>
 <div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="include"><h2 id="BookInOnePage-Database">Database</h2><p>Camel 
can work with databases in a number of different ways. This document tries to 
outline the most common approaches.</p><h3 
id="BookInOnePage-Databaseendpoints">Database endpoints</h3><p>Camel provides a 
number of different endpoints for working with databases</p><ul><li><a 
shape="rect" href="jpa.html">JPA</a> for working with hibernate, openjpa or 
toplink. When consuming from the endpoints entity beans are read (and 
deleted/updated to mark as processed) then when producing to the endpoints they 
are written to the database (via insert/update).</li><li><a shape="rect" 
href="ibatis.html">iBATIS</a> similar to the above but using <a shape="rect" 
class="external-link" href="http://ibatis.apache.org/";>Apache 
iBATIS</a></li><li><a shape="rect" href="jdbc.html">JDBC</a> similar though 
using explicit SQL</li><li><a shape="rect" href="sql-component.html">SQL<
 /a><span style="color: rgb(0,0,0);">&#160;uses<a shape="rect" 
class="external-link" 
href="http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/jdbc.html";
 rel="nofollow"> spring-jdbc</a> behind&#160;</span>the scene for the actual 
SQL handling.&#160;The difference between this component and&#160;<a 
shape="rect" class="external-link" 
href="http://camel.apache.org/jdbc.html";>JDBC</a>&#160;component is that in 
case of SQL the query is a property of the endpoint and it uses message payload 
as parameters passed to the query</li></ul><h3 
id="BookInOnePage-Databasepatternimplementations">Database pattern 
implementations</h3><p>Various patterns can work with databases as 
follows</p><ul><li><a shape="rect" href="idempotent-consumer.html">Idempotent 
Consumer</a></li><li><a shape="rect" 
href="aggregator.html">Aggregator</a></li><li><a shape="rect" 
href="bam.html">BAM</a> for business activity monitoring</li></ul></div>
-<div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="include"><h2 
id="BookInOnePage-ParallelProcessingandOrdering">Parallel Processing and 
Ordering</h2><p>It is a common requirement to want to use parallel processing 
of messages for throughput and load balancing, while at the same time process 
certain kinds of messages in order.</p><h3 
id="BookInOnePage-Howtoachieveparallelprocessing">How to achieve parallel 
processing</h3><p>You can send messages to a number of Camel <a shape="rect" 
href="components.html">Components</a> to achieve parallel processing and load 
balancing such as</p><ul><li><a shape="rect" href="seda.html">SEDA</a> for 
in-JVM load balancing across a thread pool</li><li><a shape="rect" 
href="activemq.html">ActiveMQ</a> or <a shape="rect" href="jms.html">JMS</a> 
for distributed load balancing and parallel processing</li><li><a shape="rect" 
href="jpa.html">JPA</a> for using the database as a poor mans message 
broker</li></ul><p>When processing messa
 ges concurrently, you should consider ordering and concurrency issues. These 
are described below</p><h4 id="BookInOnePage-Concurrencyissues">Concurrency 
issues</h4><p>Note that there is no concurrency or locking issue when using <a 
shape="rect" href="activemq.html">ActiveMQ</a>, <a shape="rect" 
href="jms.html">JMS</a> or <a shape="rect" href="seda.html">SEDA</a> by design; 
they are designed for highly concurrent use. However there are possible 
concurrency issues in the <a shape="rect" href="processor.html">Processor</a> 
of the messages i.e. what the processor does with the message?</p><p>For 
example if a processor of a message transfers money from one account to another 
account; you probably want to use a database with pessimistic locking to ensure 
that operation takes place atomically.</p><h4 
id="BookInOnePage-Orderingissues">Ordering issues</h4><p>As soon as you send 
multiple messages to different threads or processes you will end up with an 
unknown ordering across the entire mess
 age stream as each thread is going to process messages concurrently.</p><p>For 
many use cases the order of messages is not too important. However for some 
applications this can be crucial. e.g. if a customer submits a purchase order 
version 1, then amends it and sends version 2; you don't want to process the 
first version last (so that you loose the update). Your <a shape="rect" 
href="processor.html">Processor</a> might be clever enough to ignore old 
messages. If not you need to preserve order.</p><h3 
id="BookInOnePage-Recommendations">Recommendations</h3><p>This topic is large 
and diverse with lots of different requirements; but from a high level here are 
our recommendations on parallel processing, ordering and 
concurrency</p><ul><li>for distributed locking, use a database by default, they 
are very good at it <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/smile.svg";
 data-em
 oticon-name="smile" alt="(smile)"></li><li>to preserve ordering across a JMS 
queue consider using <a shape="rect" class="external-link" 
href="http://activemq.apache.org/exclusive-consumer.html";>Exclusive 
Consumers</a> in the <a shape="rect" href="activemq.html">ActiveMQ</a> 
component</li><li>even better are <a shape="rect" class="external-link" 
href="http://activemq.apache.org/message-groups.html";>Message Groups</a> which 
allows you to preserve ordering across messages while still offering 
parallelisation via the <strong>JMSXGroupID</strong> header to determine what 
can be parallelized</li><li>if you receive messages out of order you could use 
the <a shape="rect" href="resequencer.html">Resequencer</a> to put them back 
together again</li></ul><p>A good rule of thumb to help reduce ordering 
problems is to make sure each single can be processed as an atomic unit in 
parallel (either without concurrency issues or using say, database locking); or 
if it can't, use a <a shape="rect" class=
 "external-link" href="http://activemq.apache.org/message-groups.html";>Message 
Group</a> to relate the messages together which need to be processed in order 
by a single thread.</p><h3 id="BookInOnePage-UsingMessageGroupswithCamel">Using 
Message Groups with Camel</h3><p>To use a Message Group with Camel you just 
need to add a header to the output JMS message based on some kind of <a 
shape="rect" href="correlation-identifier.html">Correlation Identifier</a> to 
correlate messages which should be processed in order by a single thread - so 
that things which don't correlate together can be processed 
concurrently.</p><p>For example the following code shows how to create a 
message group using an XPath expression taking an invoice's product code as the 
<a shape="rect" href="correlation-identifier.html">Correlation 
Identifier</a></p><div class="code panel pdl conf-macro output-block" 
style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div 
class="codeContent panelContent pdl"
 >
+<div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="include"><h2 
id="BookInOnePage-ParallelProcessingandOrdering">Parallel Processing and 
Ordering</h2><p>It is a common requirement to want to use parallel processing 
of messages for throughput and load balancing, while at the same time process 
certain kinds of messages in order.</p><h3 
id="BookInOnePage-Howtoachieveparallelprocessing">How to achieve parallel 
processing</h3><p>You can send messages to a number of Camel <a shape="rect" 
href="components.html">Components</a> to achieve parallel processing and load 
balancing such as</p><ul><li><a shape="rect" href="seda.html">SEDA</a> for 
in-JVM load balancing across a thread pool</li><li><a shape="rect" 
href="activemq.html">ActiveMQ</a> or <a shape="rect" href="jms.html">JMS</a> 
for distributed load balancing and parallel processing</li><li><a shape="rect" 
href="jpa.html">JPA</a> for using the database as a poor mans message 
broker</li></ul><p>When processing messa
 ges concurrently, you should consider ordering and concurrency issues. These 
are described below</p><h4 id="BookInOnePage-Concurrencyissues">Concurrency 
issues</h4><p>Note that there is no concurrency or locking issue when using <a 
shape="rect" href="activemq.html">ActiveMQ</a>, <a shape="rect" 
href="jms.html">JMS</a> or <a shape="rect" href="seda.html">SEDA</a> by design; 
they are designed for highly concurrent use. However there are possible 
concurrency issues in the <a shape="rect" href="processor.html">Processor</a> 
of the messages i.e. what the processor does with the message?</p><p>For 
example if a processor of a message transfers money from one account to another 
account; you probably want to use a database with pessimistic locking to ensure 
that operation takes place atomically.</p><h4 
id="BookInOnePage-Orderingissues">Ordering issues</h4><p>As soon as you send 
multiple messages to different threads or processes you will end up with an 
unknown ordering across the entire mess
 age stream as each thread is going to process messages concurrently.</p><p>For 
many use cases the order of messages is not too important. However for some 
applications this can be crucial. e.g. if a customer submits a purchase order 
version 1, then amends it and sends version 2; you don't want to process the 
first version last (so that you loose the update). Your <a shape="rect" 
href="processor.html">Processor</a> might be clever enough to ignore old 
messages. If not you need to preserve order.</p><h3 
id="BookInOnePage-Recommendations">Recommendations</h3><p>This topic is large 
and diverse with lots of different requirements; but from a high level here are 
our recommendations on parallel processing, ordering and 
concurrency</p><ul><li>for distributed locking, use a database by default, they 
are very good at it <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/smile.svg";
 data-em
 oticon-name="smile" alt="(smile)"></li><li>to preserve ordering across a JMS 
queue consider using <a shape="rect" class="external-link" 
href="http://activemq.apache.org/exclusive-consumer.html";>Exclusive 
Consumers</a> in the <a shape="rect" href="activemq.html">ActiveMQ</a> 
component</li><li>even better are <a shape="rect" class="external-link" 
href="http://activemq.apache.org/message-groups.html";>Message Groups</a> which 
allows you to preserve ordering across messages while still offering 
parallelisation via the <strong>JMSXGroupID</strong> header to determine what 
can be parallelized</li><li>if you receive messages out of order you could use 
the <a shape="rect" href="resequencer.html">Resequencer</a> to put them back 
together again</li></ul><p>A good rule of thumb to help reduce ordering 
problems is to make sure each single can be processed as an atomic unit in 
parallel (either without concurrency issues or using say, database locking); or 
if it can't, use a <a shape="rect" class=
 "external-link" href="http://activemq.apache.org/message-groups.html";>Message 
Group</a> to relate the messages together which need to be processed in order 
by a single thread.</p><h3 id="BookInOnePage-UsingMessageGroupswithCamel">Using 
Message Groups with Camel</h3><p>To use a Message Group with Camel you just 
need to add a header to the output JMS message based on some kind of <a 
shape="rect" href="correlation-identifier.html">Correlation Identifier</a> to 
correlate messages which should be processed in order by a single thread - so 
that things which don't correlate together can be processed 
concurrently.</p><p>For example the following code shows how to create a 
message group using an XPath expression taking an invoice's product code as the 
<a shape="rect" href="correlation-identifier.html">Correlation 
Identifier</a></p><div class="code panel pdl conf-macro output-block" 
style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div 
class="codeContent panelContent pdl"
 >
 <pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java; 
gutter: false; theme: Default" 
data-theme="Default">from("activemq:a").setHeader(JmsConstants.JMS_X_GROUP_ID, 
xpath("/invoice/productCode")).to("activemq:b");
 </pre>
 </div></div><p>You can of course use the <a shape="rect" 
href="xml-configuration.html">Xml Configuration</a> if you prefer</p></div>
@@ -2360,7 +2360,7 @@ asyncProcessor.process(exchange, new Asy
 
 <p>Most folks want Queue semantics when consuming messages; so that you can 
support <a shape="rect" href="competing-consumers.html">Competing Consumers</a> 
for load balancing along with things like <a shape="rect" class="external-link" 
href="http://activemq.apache.org/message-groups.html";>Message Groups</a> and <a 
shape="rect" class="external-link" 
href="http://activemq.apache.org/exclusive-consumer.html";>Exclusive 
Consumers</a> to preserve ordering or partition the queue across consumers.</p>
 
-<p>However if you are using another JMS provider you can implement Virtual 
Topics by switching to ActiveMQ <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"> or you can use the following Camel 
pattern.</p>
+<p>However if you are using another JMS provider you can implement Virtual 
Topics by switching to ActiveMQ <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"> or you can use the following Camel 
pattern.</p>
 
 <p>First here's the ActiveMQ approach.</p>
 
@@ -2575,7 +2575,7 @@ DefaultInstrumentationAgent    INFO  JMX
 
 <h2 id="BookInOnePage-Introduction.3">Introduction</h2>
 
-<p>Creating this tutorial was inspired by a real life use-case I discussed 
over the phone with a colleague. He was working at a client whom uses a 
heavy-weight integration platform from a very large vendor. He was in talks 
with developer shops to implement a new integration on this platform. His 
trouble was the shop tripled the price when they realized the platform of 
choice. So I was wondering how we could do this integration with Camel. Can it 
be done, without tripling the cost <img class="emoticon emoticon-wink" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/wink.svg";
 data-emoticon-name="wink" alt="(wink)">.</p>
+<p>Creating this tutorial was inspired by a real life use-case I discussed 
over the phone with a colleague. He was working at a client whom uses a 
heavy-weight integration platform from a very large vendor. He was in talks 
with developer shops to implement a new integration on this platform. His 
trouble was the shop tripled the price when they realized the platform of 
choice. So I was wondering how we could do this integration with Camel. Can it 
be done, without tripling the cost <img class="emoticon emoticon-wink" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/wink.svg";
 data-emoticon-name="wink" alt="(wink)">.</p>
 
 <p>This tutorial is written during the development of the integration. I have 
decided to start off with a sample that isn't Camel's but standard Java and 
then plugin Camel as we goes. Just as when people needed to learn Spring you 
could consume it piece by piece, the same goes with Camel.</p>
 
@@ -3250,7 +3250,7 @@ INFO: Exchange[BodyType:String, Body:Cla
 </div></div>
 
 <h2 id="BookInOnePage-Writetofile-easywiththesamecodestyle">Write to file - 
easy with the same code style</h2>
-<p>Okay that isn't to impressive, Camel can log <img class="emoticon 
emoticon-wink" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/wink.svg";
 data-emoticon-name="wink" alt="(wink)"> Well I promised that the above code 
style can be used for <strong>any</strong> component, so let's store the 
payload in a file. We do this by adding the file component to the Camel 
context</p>
+<p>Okay that isn't to impressive, Camel can log <img class="emoticon 
emoticon-wink" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/wink.svg";
 data-emoticon-name="wink" alt="(wink)"> Well I promised that the above code 
style can be used for <strong>any</strong> component, so let's store the 
payload in a file. We do this by adding the file component to the Camel 
context</p>
 <div class="code panel pdl conf-macro output-block" style="border-width: 1px;" 
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent 
pdl">
 <pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java; 
gutter: false; theme: Default" data-theme="Default">
         // add the file component
@@ -3902,7 +3902,7 @@ public class ReportIncidentConsumerTest
 <blockquote>
 <p>you must unlearn what you have learned<br clear="none">
 <em>Master Yoda, Star Wars IV</em></p></blockquote>
-<p>So we start all over again! <img class="emoticon emoticon-wink" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/wink.svg";
 data-emoticon-name="wink" alt="(wink)"></p></div></div>
+<p>So we start all over again! <img class="emoticon emoticon-wink" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/wink.svg";
 data-emoticon-name="wink" alt="(wink)"></p></div></div>
 
 <h2 id="BookInOnePage-Routing">Routing</h2>
 <p>Camel is particular strong as a light-weight and agile 
<strong>routing</strong> and <strong>mediation</strong> framework. In this part 
we will introduce the <strong>routing</strong> concept and how we can introduce 
this into our solution.<br clear="none">
@@ -4407,11 +4407,11 @@ So we completed the last piece in the pi
 <p>This example has been removed from <strong>Camel 2.9</strong> onwards. 
Apache Axis 1.4 is a very old and unsupported framework. We encourage users to 
use <a shape="rect" href="cxf.html">CXF</a> instead of Axis.</p></div></div>
 
 <div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="toc"><style type="text/css">/*<![CDATA[*/
-div.rbtoc1555172388945 {padding: 0px;}
-div.rbtoc1555172388945 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1555172388945 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1556039945549 {padding: 0px;}
+div.rbtoc1556039945549 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1556039945549 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style><div class="toc-macro rbtoc1555172388945">
+/*]]>*/</style><div class="toc-macro rbtoc1556039945549">
 <ul class="toc-indentation"><li><a shape="rect" 
href="#BookInOnePage-TutorialusingAxis1.4withApacheCamel">Tutorial using Axis 
1.4 with Apache Camel</a>
 <ul class="toc-indentation"><li><a shape="rect" 
href="#BookInOnePage-Prerequisites">Prerequisites</a></li><li><a shape="rect" 
href="#BookInOnePage-Distribution">Distribution</a></li><li><a shape="rect" 
href="#BookInOnePage-Introduction">Introduction</a></li><li><a shape="rect" 
href="#BookInOnePage-SettinguptheprojecttorunAxis">Setting up the project to 
run Axis</a>
 <ul class="toc-indentation"><li><a shape="rect" 
href="#BookInOnePage-Maven2">Maven 2</a></li><li><a shape="rect" 
href="#BookInOnePage-wsdl">wsdl</a></li><li><a shape="rect" 
href="#BookInOnePage-ConfiguringAxis">Configuring Axis</a></li><li><a 
shape="rect" href="#BookInOnePage-RunningtheExample">Running the 
Example</a></li></ul>
@@ -6711,7 +6711,7 @@ simple("${in.header.type} == ${bean:orde
        &lt;to uri="mock:fooOrders"/&gt;
    &lt;/filter&gt;
 &lt;/from&gt;
-</plain-text-body><p>The Simple language can be used for the predicate test 
above in the <a shape="rect" href="message-filter.html">Message Filter</a> 
pattern, where we test if the in message has a 
<strong><code>foo</code></strong> header (a header with the key 
<strong><code>foo</code></strong> exists). If the expression evaluates 
to&#160;<strong><code>true</code></strong> then the message is routed to the 
<strong><code>mock:fooOrders</code></strong> endpoint, otherwise it is lost in 
the deep blue sea <img class="emoticon emoticon-wink" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/wink.svg";
 data-emoticon-name="wink" alt="(wink)">.</p><p>The same example in Java 
DSL:</p><parameter 
ac:name="">java</parameter><plain-text-body>from("seda:orders")
+</plain-text-body><p>The Simple language can be used for the predicate test 
above in the <a shape="rect" href="message-filter.html">Message Filter</a> 
pattern, where we test if the in message has a 
<strong><code>foo</code></strong> header (a header with the key 
<strong><code>foo</code></strong> exists). If the expression evaluates 
to&#160;<strong><code>true</code></strong> then the message is routed to the 
<strong><code>mock:fooOrders</code></strong> endpoint, otherwise it is lost in 
the deep blue sea <img class="emoticon emoticon-wink" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/wink.svg";
 data-emoticon-name="wink" alt="(wink)">.</p><p>The same example in Java 
DSL:</p><parameter 
ac:name="">java</parameter><plain-text-body>from("seda:orders")
   .filter().simple("${in.header.foo}")
   .to("seda:fooOrders");
 </plain-text-body><p>You can also use the simple language for simple text 
concatenations such as:</p><parameter 
ac:name="">java</parameter><plain-text-body>from("direct:hello")
@@ -7589,7 +7589,7 @@ getContext().getProperties().put("CamelJ
 <div class="confluence-information-macro confluence-information-macro-tip 
conf-macro output-block" data-hasbody="true" data-macro-name="tip"><p 
class="title">Camel eats our own -dog food- soap</p><span class="aui-icon 
aui-icon-small aui-iconfont-approve confluence-information-macro-icon"> 
</span><div class="confluence-information-macro-body">
 <p>We had some issues in our pdf <a shape="rect" href="manual.html">Manual</a> 
where we had some strange symbols. So <a shape="rect" class="external-link" 
href="http://janstey.blogspot.com/"; rel="nofollow">Jonathan</a> used this data 
format to tidy up the wiki html pages that are used as base for rendering the 
pdf manuals. And then the mysterious symbols vanished.</p></div></div> 
 
-<p><a shape="rect" href="tidymarkup.html">TidyMarkup</a> only supports the 
<strong>unmarshal</strong> operation as we really don't want to turn well 
formed HTML into ugly HTML <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"></p>
+<p><a shape="rect" href="tidymarkup.html">TidyMarkup</a> only supports the 
<strong>unmarshal</strong> operation as we really don't want to turn well 
formed HTML into ugly HTML <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"></p>
 
 <h3 id="BookInOnePage-JavaDSLExample">Java DSL Example</h3>
 <p>An example where the consumer provides some HTML</p>
@@ -10887,7 +10887,7 @@ from("jms:MyQueue?concurrentConsumers=5"
 </pre>
 </div></div>
 
-<p>Or just run multiple JVMs of any <a shape="rect" 
href="activemq.html">ActiveMQ</a> or <a shape="rect" href="jms.html">JMS</a> 
route <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/7901/17fbf59dc6f69bee0caf86e0cbbd7fb3bd9d8b4a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"></p>
+<p>Or just run multiple JVMs of any <a shape="rect" 
href="activemq.html">ActiveMQ</a> or <a shape="rect" href="jms.html">JMS</a> 
route <img class="emoticon emoticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/8100/4410012ac87e845516b70bc69b6f7a893eabaa5a/_/images/icons/emoticons/smile.svg";
 data-emoticon-name="smile" alt="(smile)"></p>
 
 <div class="conf-macro output-block" data-hasbody="false" 
data-macro-name="include"><h4 id="BookInOnePage-UsingThisPattern.18">Using This 
Pattern</h4>
 
@@ -14549,7 +14549,7 @@ rnc:someLocalOrRemoteResource</pre>
 </plain-text-body><p>Where <strong><code>destinationName</code></strong> is a 
JMS queue or topic name. By default, the 
<strong><code>destinationName</code></strong> is interpreted as a queue name. 
For example, to connect to the queue, <strong><code>FOO.BAR</code></strong> 
use:</p><plain-text-body>jms:FOO.BAR
 </plain-text-body><p>You can include the optional 
<strong><code>queue:</code></strong> prefix, if you 
prefer:</p><plain-text-body>jms:queue:FOO.BAR
 </plain-text-body><p>To connect to a topic, you <em>must</em> include the 
<strong><code>topic:</code></strong> prefix. For example, to connect to the 
topic, <strong><code>Stocks.Prices</code></strong>, 
use:</p><plain-text-body>jms:topic:Stocks.Prices

[... 32 lines stripped ...]

Reply via email to