Modified: websites/production/camel/content/book-cookbook.html
==============================================================================
--- websites/production/camel/content/book-cookbook.html (original)
+++ websites/production/camel/content/book-cookbook.html Sun Jun 11 03:29:17 
2017
@@ -976,8 +976,8 @@ When writing software these days, its im
 
 <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/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/smile.png";
 data-emoticon-name="smile" alt="(smile)"></p>
-<h2 id="Bookcookbook-Visualisation">Visualisation</h2><div 
class="confluence-information-macro confluence-information-macro-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-cookbook.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-link" 
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="Bookcookbook-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="Bookcookbook-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 e
 moticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/smile.png";
 data-emoticon-name="smile" alt="(smile)"></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/5997/6f42626d00e36f53fe51440403446ca61552e2a2.1/_/images/icons/emoticons/smile.png";
 data-emoticon-name="smile" alt="(smile)"></p>
+<h2 id="Bookcookbook-Visualisation">Visualisation</h2><div 
class="confluence-information-macro confluence-information-macro-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-cookbook.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-link" 
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="Bookcookbook-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="Bookcookbook-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 e
 moticon-smile" 
src="https://cwiki.apache.org/confluence/s/en_GB/5997/6f42626d00e36f53fe51440403446ca61552e2a2.1/_/images/icons/emoticons/smile.png";
 data-emoticon-name="smile" alt="(smile)"></p>
 <h2 id="Bookcookbook-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>
@@ -1340,7 +1340,7 @@ public class IsMockEndpointsAndSkipJUnit
 ]]></script>
 </div></div><div class="confluence-information-macro 
confluence-information-macro-tip"><p class="title">time units</p><span 
class="aui-icon aui-icon-small aui-iconfont-approve 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-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></div></div><p></p><h3 id="Bookcookbook-SeeAlso">See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html">Configuring 
Camel</a></li><li><a shape="rect" 
href="component.html">Component</a></li><li><a shape="rect" 
href="endpoint.html">Endpoint</a></li><li><a shape="rect" 
href="getting-started.html">Getting Started</a></li></ul><ul><li><a 
shape="rect" href="spring-testing.html">Spring Testing</a></li><li><a 
shape="rect" href="testing.html">Testing</a></li></ul>
-<h2 id="Bookcookbook-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/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/smile.png";
 data-emoticon-name="smile" alt="(smile)"> . Testing is the crucial weapon to 
ensure that things work as you would expect.</p><p>Camel is a Java library so 
you can easily wire up tests in whatever un
 it 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="Bookcookbook-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 w
 ithout 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 configuration 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><code>camel-guice</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><s
 pan 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 supports Spring 
Test&#160;based tests that use the declarative style of test configurati
 on 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="Bookcookbook-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>:</p><div
 class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
+<h2 id="Bookcookbook-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/5997/6f42626d00e36f53fe51440403446ca61552e2a2.1/_/images/icons/emoticons/smile.png";
 data-emoticon-name="smile" alt="(smile)"> . Testing is the crucial weapon to 
ensure that things work as you would expect.</p><p>Camel is a Java library so 
you can easily wire up tests in whatever un
 it 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="Bookcookbook-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 w
 ithout 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 configuration 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><code>camel-guice</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><s
 pan 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 supports Spring 
Test&#160;based tests that use the declarative style of test configurati
 on 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="Bookcookbook-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>:</p><div
 class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
 // tag::example[]
 public class FilterTest extends CamelTestSupport {
@@ -2166,7 +2166,7 @@ public class MyModule extends CamelModul
 ]]></script>
 </div></div><h3 id="Bookcookbook-SeeAlso.4">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>
 <h2 id="Bookcookbook-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="Bookcookbook-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" hr
 
ef="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="Bookcookbook-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>
-<h2 id="Bookcookbook-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="Bookcookbook-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 messages concurrently, you should consider 
ordering and concurrency issues. These are descr
 ibed below</p><h4 id="Bookcookbook-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="Bookcookbook-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 message 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="Bookcookbook-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/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/smile.png";
 data-emoticon-name="smile" alt="(smile)"></li><li>to preserve ordering across 
a JMS queue cons
 ider 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="Bookcookbook-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" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+<h2 id="Bookcookbook-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="Bookcookbook-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 messages concurrently, you should consider 
ordering and concurrency issues. These are descr
 ibed below</p><h4 id="Bookcookbook-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="Bookcookbook-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 message 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="Bookcookbook-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/5997/6f42626d00e36f53fe51440403446ca61552e2a2.1/_/images/icons/emoticons/smile.png";
 data-emoticon-name="smile" alt="(smile)"></li><li>to preserve ordering across 
a JMS queue cons
 ider 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="Bookcookbook-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" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[from(&quot;activemq:a&quot;).setHeader(JmsConstants.JMS_X_GROUP_ID,
 xpath(&quot;/invoice/productCode&quot;)).to(&quot;activemq:b&quot;);
 ]]></script>
 </div></div><p>You can of course use the <a shape="rect" 
href="xml-configuration.html">Xml Configuration</a> if you prefer</p>
@@ -2212,7 +2212,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/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/smile.png";
 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/5997/6f42626d00e36f53fe51440403446ca61552e2a2.1/_/images/icons/emoticons/smile.png";
 data-emoticon-name="smile" alt="(smile)"> or you can use the following Camel 
pattern.</p>
 
 <p>First here's the ActiveMQ approach.</p>
 

Modified: websites/production/camel/content/book-dataformat-appendix.html
==============================================================================
--- websites/production/camel/content/book-dataformat-appendix.html (original)
+++ websites/production/camel/content/book-dataformat-appendix.html Sun Jun 11 
03:29:17 2017
@@ -979,7 +979,7 @@ The Zip <a shape="rect" href="data-forma
 <div class="confluence-information-macro confluence-information-macro-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/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/smile.png";
 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/5997/6f42626d00e36f53fe51440403446ca61552e2a2.1/_/images/icons/emoticons/smile.png";
 data-emoticon-name="smile" alt="(smile)"></p>
 
 <h3 id="BookDataFormatAppendix-JavaDSLExample">Java DSL Example</h3>
 <p>An example where the consumer provides some HTML</p>


Reply via email to