You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2016/04/01 16:19:01 UTC

svn commit: r984432 - in /websites/production/camel/content: book-component-appendix.html book-cookbook.html book-in-one-page.html cache/main.pageCache templating.html velocity.html

Author: buildbot
Date: Fri Apr  1 14:19:01 2016
New Revision: 984432

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/book-component-appendix.html
    websites/production/camel/content/book-cookbook.html
    websites/production/camel/content/book-in-one-page.html
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/templating.html
    websites/production/camel/content/velocity.html

Modified: websites/production/camel/content/book-component-appendix.html
==============================================================================
--- websites/production/camel/content/book-component-appendix.html (original)
+++ websites/production/camel/content/book-component-appendix.html Fri Apr  1 14:19:01 2016
@@ -1016,11 +1016,11 @@ template.send("direct:alias-verify&
 ]]></script>
 </div></div><p></p><h3 id="BookComponentAppendix-SeeAlso.8">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="crypto.html">Crypto</a> Crypto is also available as a <a shape="rect" href="data-format.html">Data Format</a></li></ul> <h2 id="BookComponentAppendix-CXFComponent">CXF Component</h2><div class="confluence-information-macro confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When using CXF as a consumer, the <a shape="rect" href="cxf-bean-component.html">CXF Bean Component</a> allows you to factor out how message payloads are received from their processing as a RESTful or SOAP web service. This has the potential of using a multitude of transports to cons
 ume web services. The bean component's configuration is also simpler and provides the fastest method to implement web services using Camel and CXF.</p></div></div><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When using CXF in streaming modes (see DataFormat option), then also read about <a shape="rect" href="stream-caching.html">Stream caching</a>.</p></div></div><p>The <strong>cxf:</strong> component provides integration with <a shape="rect" href="http://cxf.apache.org">Apache CXF</a> for connecting to JAX-WS services hosted in CXF.</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1459513066089 {padding: 0px;}
-div.rbtoc1459513066089 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1459513066089 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1459520256847 {padding: 0px;}
+div.rbtoc1459520256847 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1459520256847 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1459513066089">
+/*]]>*/</style></p><div class="toc-macro rbtoc1459520256847">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookComponentAppendix-CXFComponent">CXF Component</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookComponentAppendix-URIformat">URI format</a></li><li><a shape="rect" href="#BookComponentAppendix-Options">Options</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookComponentAppendix-Thedescriptionsofthedataformats">The descriptions of the dataformats</a>
@@ -10267,7 +10267,7 @@ template.requestBodyAndHeader(&quot;dire
 </div></div><h3 id="BookComponentAppendix-URIformat.72">URI format</h3><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[velocity:templateName[?options]
 ]]></script>
-</div></div><p>Where <strong>templateName</strong> is the classpath-local URI of the template to invoke; or the complete URL of the remote template (eg: <a shape="rect" class="external-link" href="file://folder/myfile.vm" rel="nofollow">file://folder/myfile.vm</a>).</p><p>You can append query options to the URI in the following format, <code>?option=value&amp;option=value&amp;...</code></p><h3 id="BookComponentAppendix-Options.57">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>loaderCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Velocity based file
  loader cache.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>contentCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Cache for the resource content when it is loaded. <br clear="none" class="atl-forced-newline"> Note : as of Camel 2.9 cached resource content can be cleared via JMX using the endpoint's <code>clearContentCache</code> operation.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>encoding</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Character encoding of the resource content.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>propertiesFile</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>New option in
  Camel 2.1: The URI of the properties file which is used for VelocityEngine initialization.</p></td></tr></tbody></table></div></div><h3 id="BookComponentAppendix-MessageHeaders.19">Message Headers</h3><p>The velocity component sets a couple headers on the message (you can't set these yourself and from Camel 2.1 velocity component will not set these headers which will cause some side effect on the dynamic template support):</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelVelocityResourceUri</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The <strong>templateName</strong> as a <code>String</code> object.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>CamelVelocitySupplementalCont
 ext</code></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.16:</strong> To add additional information to the used VelocityContext. The value of this header should be a <code>Map</code> with key/values that will added (override any existing key with the same name).<br clear="none">This can be used to pre setup some common key/values you want to reuse in your velocity endpoints.</p></td></tr></tbody></table></div></div><p>Headers set during the Velocity evaluation are returned to the message and added as headers. Then its kinda possible to return values from Velocity to the Message.</p><p>For example, to set the header value of <code>fruit</code> in the Velocity template <code>.tm</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Where <strong>templateName</strong> is the classpath-local URI of the template to invoke; or the complete URL of the remote template (eg: <a shape="rect" class="external-link" href="file://folder/myfile.vm" rel="nofollow">file://folder/myfile.vm</a>).</p><p>You can append query options to the URI in the following format, <code>?option=value&amp;option=value&amp;...</code></p><h3 id="BookComponentAppendix-Options.57">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>loaderCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Velocity based file
  loader cache.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>contentCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Cache for the resource content when it is loaded. <br clear="none" class="atl-forced-newline"> Note : as of Camel 2.9 cached resource content can be cleared via JMX using the endpoint's <code>clearContentCache</code> operation.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>encoding</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Character encoding of the resource content.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>propertiesFile</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>New option in
  Camel 2.1: The URI of the properties file which is used for VelocityEngine initialization.</p></td></tr></tbody></table></div></div><h3 id="BookComponentAppendix-MessageHeaders.19">Message Headers</h3><p>The velocity component sets a couple headers on the message (you can't set these yourself and from Camel 2.1 velocity component will not set these headers which will cause some side effect on the dynamic template support):</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelVelocityResourceUri</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The <strong>templateName</strong> as a <code>String</code> object.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelVelocitySupplementalC
 ontext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.16:</strong> To add additional information to the used VelocityContext. The value of this header should be a <code>Map</code> with key/values that will added (override any existing key with the same name).<br clear="none">This can be used to pre setup some common key/values you want to reuse in your velocity endpoints.</p></td></tr></tbody></table></div></div><p>Headers set during the Velocity evaluation are returned to the message and added as headers. Then its kinda possible to return values from Velocity to the Message.</p><p>For example, to set the header value of <code>fruit</code> in the Velocity template <code>.tm</code>:</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[$in.setHeader(&quot;fruit&quot;, &quot;Apple&quot;)
 ]]></script>
 </div></div><p>The <code>fruit</code> header is now accessible from the <code>message.out.headers</code>.</p><h3 id="BookComponentAppendix-VelocityContext">Velocity Context</h3><p>Camel will provide exchange information in the Velocity context (just a <code>Map</code>). The <code>Exchange</code> is transfered as:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>key</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The <code>Exchange</code> itself.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>exchange.properties</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The <code>Exchange</code> properties.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><co
 de>headers</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The headers of the In message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>camelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context instance.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>request</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The In message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>in</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The In message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>body</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The In message body.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>out</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Out message (only for InOut message exchange pattern).</p></
 td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>response</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Out message (only for InOut message exchange pattern).</p></td></tr></tbody></table></div></div><p>Since Camel-2.14, you can setup a custom Velocity Context yourself by setting the message header <strong>CamelVelocityContext&#160;</strong>just like this</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">

Modified: websites/production/camel/content/book-cookbook.html
==============================================================================
--- websites/production/camel/content/book-cookbook.html (original)
+++ websites/production/camel/content/book-cookbook.html Fri Apr  1 14:19:01 2016
@@ -2265,46 +2265,16 @@ public class MyModule extends CamelModul
 <h3 id="Bookcookbook-SeeAlso.3">See Also</h3>
 
 <ul><li>there are a number of <a shape="rect" href="examples.html">Examples</a> you can look at to see Guice and Camel being used such as <a shape="rect" href="guice-jms-example.html">Guice JMS Example</a></li><li><a shape="rect" href="guice-maven-plugin.html">Guice Maven Plugin</a> for running your Guice based routes via Maven</li></ul>
-<h2 id="Bookcookbook-Templating">Templating</h2>
-
-<p>When you are testing distributed systems its a very common requirement to have to stub out certain external systems with some stub so that you can test other parts of the system until a specific system is available or written etc.</p>
-
-<p>A great way to do this is using some kind of Template system to generate responses to requests generating a dynamic message using a mostly-static body.</p>
-
-<p>There are a number of templating components included in the Camel distribution you could use</p>
-
-<ul><li><a shape="rect" href="freemarker.html">FreeMarker</a></li><li><a shape="rect" href="stringtemplate.html">StringTemplate</a></li><li><a shape="rect" href="velocity.html">Velocity</a></li><li><a shape="rect" href="xquery.html">XQuery</a></li><li><a shape="rect" href="xslt.html">XSLT</a></li></ul>
-
-
-<p>or the following external Camel components</p>
-
-<ul><li><a shape="rect" class="external-link" href="http://scalate.fusesource.org/camel.html" rel="nofollow">Scalate</a></li></ul>
-
-
-<h3 id="Bookcookbook-Example.1">Example</h3>
-
-<p>Here's a simple example showing how we can respond to InOut requests on the <strong>My.Queue</strong> queue on <a shape="rect" href="activemq.html">ActiveMQ</a> with a template generated response. The reply would be sent back to the JMSReplyTo Destination.</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:My.Queue&quot;).
+<h2 id="Bookcookbook-Templating">Templating</h2><p>When you are testing distributed systems its a very common requirement to have to stub out certain external systems with some stub so that you can test other parts of the system until a specific system is available or written etc.</p><p>A great way to do this is using some kind of Template system to generate responses to requests generating a dynamic message using a mostly-static body.</p><p>There are a number of templating components included in the Camel distribution you could use</p><ul><li><a shape="rect" href="freemarker.html">FreeMarker</a></li><li><a shape="rect" href="mustache.html">Mustache</a></li><li><a shape="rect" href="stringtemplate.html">StringTemplate</a></li><li><a shape="rect" href="velocity.html">Velocity</a></li><li><a shape="rect" href="xquery.html">XQuery</a></li><li><a shape="rect" href="xslt.html">XSLT</a></li></ul><p>or the following external Camel components</p><ul><li><a shape="rect" class="external-link"
  href="http://scalate.fusesource.org/camel.html" rel="nofollow">Scalate</a></li></ul><h3 id="Bookcookbook-Example.1">Example</h3><p>Here's a simple example showing how we can respond to InOut requests on the <strong>My.Queue</strong> queue on <a shape="rect" href="activemq.html">ActiveMQ</a> with a template generated response. The reply would be sent back to the JMSReplyTo Destination.</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:My.Queue&quot;).
   to(&quot;velocity:com/acme/MyResponse.vm&quot;);
 ]]></script>
-</div></div>
-
-<p>If you want to use InOnly and consume the message and send it to another destination you could use</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:My.Queue&quot;).
+</div></div><p>If you want to use InOnly and consume the message and send it to another destination you could use</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:My.Queue&quot;).
   to(&quot;velocity:com/acme/MyResponse.vm&quot;).
   to(&quot;activemq:Another.Queue&quot;);
 ]]></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>
+</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">
 <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;);

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 Fri Apr  1 14:19:01 2016
@@ -3318,46 +3318,16 @@ public class MyModule extends CamelModul
 <h3 id="BookInOnePage-SeeAlso.3">See Also</h3>
 
 <ul><li>there are a number of <a shape="rect" href="examples.html">Examples</a> you can look at to see Guice and Camel being used such as <a shape="rect" href="guice-jms-example.html">Guice JMS Example</a></li><li><a shape="rect" href="guice-maven-plugin.html">Guice Maven Plugin</a> for running your Guice based routes via Maven</li></ul>
-<h2 id="BookInOnePage-Templating">Templating</h2>
-
-<p>When you are testing distributed systems its a very common requirement to have to stub out certain external systems with some stub so that you can test other parts of the system until a specific system is available or written etc.</p>
-
-<p>A great way to do this is using some kind of Template system to generate responses to requests generating a dynamic message using a mostly-static body.</p>
-
-<p>There are a number of templating components included in the Camel distribution you could use</p>
-
-<ul><li><a shape="rect" href="freemarker.html">FreeMarker</a></li><li><a shape="rect" href="stringtemplate.html">StringTemplate</a></li><li><a shape="rect" href="velocity.html">Velocity</a></li><li><a shape="rect" href="xquery.html">XQuery</a></li><li><a shape="rect" href="xslt.html">XSLT</a></li></ul>
-
-
-<p>or the following external Camel components</p>
-
-<ul><li><a shape="rect" class="external-link" href="http://scalate.fusesource.org/camel.html" rel="nofollow">Scalate</a></li></ul>
-
-
-<h3 id="BookInOnePage-Example.1">Example</h3>
-
-<p>Here's a simple example showing how we can respond to InOut requests on the <strong>My.Queue</strong> queue on <a shape="rect" href="activemq.html">ActiveMQ</a> with a template generated response. The reply would be sent back to the JMSReplyTo Destination.</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:My.Queue&quot;).
+<h2 id="BookInOnePage-Templating">Templating</h2><p>When you are testing distributed systems its a very common requirement to have to stub out certain external systems with some stub so that you can test other parts of the system until a specific system is available or written etc.</p><p>A great way to do this is using some kind of Template system to generate responses to requests generating a dynamic message using a mostly-static body.</p><p>There are a number of templating components included in the Camel distribution you could use</p><ul><li><a shape="rect" href="freemarker.html">FreeMarker</a></li><li><a shape="rect" href="mustache.html">Mustache</a></li><li><a shape="rect" href="stringtemplate.html">StringTemplate</a></li><li><a shape="rect" href="velocity.html">Velocity</a></li><li><a shape="rect" href="xquery.html">XQuery</a></li><li><a shape="rect" href="xslt.html">XSLT</a></li></ul><p>or the following external Camel components</p><ul><li><a shape="rect" class="external-link
 " href="http://scalate.fusesource.org/camel.html" rel="nofollow">Scalate</a></li></ul><h3 id="BookInOnePage-Example.1">Example</h3><p>Here's a simple example showing how we can respond to InOut requests on the <strong>My.Queue</strong> queue on <a shape="rect" href="activemq.html">ActiveMQ</a> with a template generated response. The reply would be sent back to the JMSReplyTo Destination.</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:My.Queue&quot;).
   to(&quot;velocity:com/acme/MyResponse.vm&quot;);
 ]]></script>
-</div></div>
-
-<p>If you want to use InOnly and consume the message and send it to another destination you could use</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:My.Queue&quot;).
+</div></div><p>If you want to use InOnly and consume the message and send it to another destination you could use</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:My.Queue&quot;).
   to(&quot;velocity:com/acme/MyResponse.vm&quot;).
   to(&quot;activemq:Another.Queue&quot;);
 ]]></script>
-</div></div>
-
-<h3 id="BookInOnePage-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>
+</div></div><h3 id="BookInOnePage-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="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>
 <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 messages concurrently, you should consider ordering and concurrency issues. These are des
 cribed 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 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="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/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/smile.png" data-emoticon-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 Grou
 p</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" 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;);
@@ -3729,11 +3699,11 @@ The tutorial has been designed in two pa
 While not actual tutorials you might find working through the source of the various <a shape="rect" href="examples.html">Examples</a> useful.</li></ul>
 
 <h2 id="BookInOnePage-TutorialonSpringRemotingwithJMS">Tutorial on Spring Remoting with JMS</h2><p>&#160;</p><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Thanks</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>This tutorial was kindly donated to Apache Camel by Martin Gilday.</p></div></div><h2 id="BookInOnePage-Preface">Preface</h2><p>This tutorial aims to guide the reader through the stages of creating a project which uses Camel to facilitate the routing of messages from a JMS queue to a <a shape="rect" class="external-link" href="http://www.springramework.org" rel="nofollow">Spring</a> service. The route works in a synchronous fashion returning a response to the client.</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1459513078343 {padding: 0px;}
-div.rbtoc1459513078343 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1459513078343 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1459520267295 {padding: 0px;}
+div.rbtoc1459520267295 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1459520267295 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1459513078343">
+/*]]>*/</style></p><div class="toc-macro rbtoc1459520267295">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-TutorialonSpringRemotingwithJMS">Tutorial on Spring Remoting with JMS</a></li><li><a shape="rect" href="#BookInOnePage-Preface">Preface</a></li><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-About">About</a></li><li><a shape="rect" href="#BookInOnePage-CreatetheCamelProject">Create the Camel Project</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-UpdatethePOMwithDependencies">Update the POM with Dependencies</a></li></ul>
 </li><li><a shape="rect" href="#BookInOnePage-WritingtheServer">Writing the Server</a>
@@ -5848,11 +5818,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>
 
 <style type="text/css">/*<![CDATA[*/
-div.rbtoc1459513078767 {padding: 0px;}
-div.rbtoc1459513078767 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1459513078767 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1459520267642 {padding: 0px;}
+div.rbtoc1459520267642 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1459520267642 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style><div class="toc-macro rbtoc1459513078767">
+/*]]>*/</style><div class="toc-macro rbtoc1459520267642">
 <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>
@@ -17281,11 +17251,11 @@ template.send(&quot;direct:alias-verify&
 ]]></script>
 </div></div><p></p><h3 id="BookInOnePage-SeeAlso.28">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="crypto.html">Crypto</a> Crypto is also available as a <a shape="rect" href="data-format.html">Data Format</a></li></ul> <h2 id="BookInOnePage-CXFComponent">CXF Component</h2><div class="confluence-information-macro confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When using CXF as a consumer, the <a shape="rect" href="cxf-bean-component.html">CXF Bean Component</a> allows you to factor out how message payloads are received from their processing as a RESTful or SOAP web service. This has the potential of using a multitude of transports to consume web 
 services. The bean component's configuration is also simpler and provides the fastest method to implement web services using Camel and CXF.</p></div></div><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When using CXF in streaming modes (see DataFormat option), then also read about <a shape="rect" href="stream-caching.html">Stream caching</a>.</p></div></div><p>The <strong>cxf:</strong> component provides integration with <a shape="rect" href="http://cxf.apache.org">Apache CXF</a> for connecting to JAX-WS services hosted in CXF.</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1459513082108 {padding: 0px;}
-div.rbtoc1459513082108 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1459513082108 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1459520269914 {padding: 0px;}
+div.rbtoc1459520269914 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1459520269914 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1459513082108">
+/*]]>*/</style></p><div class="toc-macro rbtoc1459520269914">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-CXFComponent">CXF Component</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-URIformat">URI format</a></li><li><a shape="rect" href="#BookInOnePage-Options">Options</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-Thedescriptionsofthedataformats">The descriptions of the dataformats</a>
@@ -26532,7 +26502,7 @@ template.requestBodyAndHeader(&quot;dire
 </div></div><h3 id="BookInOnePage-URIformat.73">URI format</h3><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[velocity:templateName[?options]
 ]]></script>
-</div></div><p>Where <strong>templateName</strong> is the classpath-local URI of the template to invoke; or the complete URL of the remote template (eg: <a shape="rect" class="external-link" href="file://folder/myfile.vm" rel="nofollow">file://folder/myfile.vm</a>).</p><p>You can append query options to the URI in the following format, <code>?option=value&amp;option=value&amp;...</code></p><h3 id="BookInOnePage-Options.78">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>loaderCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Velocity based file loader 
 cache.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>contentCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Cache for the resource content when it is loaded. <br clear="none" class="atl-forced-newline"> Note : as of Camel 2.9 cached resource content can be cleared via JMX using the endpoint's <code>clearContentCache</code> operation.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>encoding</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Character encoding of the resource content.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>propertiesFile</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>New option in Camel 2
 .1: The URI of the properties file which is used for VelocityEngine initialization.</p></td></tr></tbody></table></div></div><h3 id="BookInOnePage-MessageHeaders.19">Message Headers</h3><p>The velocity component sets a couple headers on the message (you can't set these yourself and from Camel 2.1 velocity component will not set these headers which will cause some side effect on the dynamic template support):</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelVelocityResourceUri</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The <strong>templateName</strong> as a <code>String</code> object.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>CamelVelocitySupplementalContext</code></td><
 td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.16:</strong> To add additional information to the used VelocityContext. The value of this header should be a <code>Map</code> with key/values that will added (override any existing key with the same name).<br clear="none">This can be used to pre setup some common key/values you want to reuse in your velocity endpoints.</p></td></tr></tbody></table></div></div><p>Headers set during the Velocity evaluation are returned to the message and added as headers. Then its kinda possible to return values from Velocity to the Message.</p><p>For example, to set the header value of <code>fruit</code> in the Velocity template <code>.tm</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Where <strong>templateName</strong> is the classpath-local URI of the template to invoke; or the complete URL of the remote template (eg: <a shape="rect" class="external-link" href="file://folder/myfile.vm" rel="nofollow">file://folder/myfile.vm</a>).</p><p>You can append query options to the URI in the following format, <code>?option=value&amp;option=value&amp;...</code></p><h3 id="BookInOnePage-Options.78">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>loaderCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Velocity based file loader 
 cache.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>contentCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Cache for the resource content when it is loaded. <br clear="none" class="atl-forced-newline"> Note : as of Camel 2.9 cached resource content can be cleared via JMX using the endpoint's <code>clearContentCache</code> operation.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>encoding</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Character encoding of the resource content.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>propertiesFile</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>New option in Camel 2
 .1: The URI of the properties file which is used for VelocityEngine initialization.</p></td></tr></tbody></table></div></div><h3 id="BookInOnePage-MessageHeaders.19">Message Headers</h3><p>The velocity component sets a couple headers on the message (you can't set these yourself and from Camel 2.1 velocity component will not set these headers which will cause some side effect on the dynamic template support):</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelVelocityResourceUri</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The <strong>templateName</strong> as a <code>String</code> object.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelVelocitySupplementalContext</code></p
 ></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.16:</strong> To add additional information to the used VelocityContext. The value of this header should be a <code>Map</code> with key/values that will added (override any existing key with the same name).<br clear="none">This can be used to pre setup some common key/values you want to reuse in your velocity endpoints.</p></td></tr></tbody></table></div></div><p>Headers set during the Velocity evaluation are returned to the message and added as headers. Then its kinda possible to return values from Velocity to the Message.</p><p>For example, to set the header value of <code>fruit</code> in the Velocity template <code>.tm</code>:</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[$in.setHeader(&quot;fruit&quot;, &quot;Apple&quot;)
 ]]></script>
 </div></div><p>The <code>fruit</code> header is now accessible from the <code>message.out.headers</code>.</p><h3 id="BookInOnePage-VelocityContext">Velocity Context</h3><p>Camel will provide exchange information in the Velocity context (just a <code>Map</code>). The <code>Exchange</code> is transfered as:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>key</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The <code>Exchange</code> itself.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>exchange.properties</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The <code>Exchange</code> properties.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>heade
 rs</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The headers of the In message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>camelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context instance.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>request</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The In message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>in</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The In message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>body</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The In message body.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>out</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Out message (only for InOut message exchange pattern).</p></td></tr>
 <tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>response</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Out message (only for InOut message exchange pattern).</p></td></tr></tbody></table></div></div><p>Since Camel-2.14, you can setup a custom Velocity Context yourself by setting the message header <strong>CamelVelocityContext&#160;</strong>just like this</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/camel/content/templating.html
==============================================================================
--- websites/production/camel/content/templating.html (original)
+++ websites/production/camel/content/templating.html Fri Apr  1 14:19:01 2016
@@ -84,46 +84,16 @@
 	<tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="Templating-Templating">Templating</h2>
-
-<p>When you are testing distributed systems its a very common requirement to have to stub out certain external systems with some stub so that you can test other parts of the system until a specific system is available or written etc.</p>
-
-<p>A great way to do this is using some kind of Template system to generate responses to requests generating a dynamic message using a mostly-static body.</p>
-
-<p>There are a number of templating components included in the Camel distribution you could use</p>
-
-<ul><li><a shape="rect" href="freemarker.html">FreeMarker</a></li><li><a shape="rect" href="stringtemplate.html">StringTemplate</a></li><li><a shape="rect" href="velocity.html">Velocity</a></li><li><a shape="rect" href="xquery.html">XQuery</a></li><li><a shape="rect" href="xslt.html">XSLT</a></li></ul>
-
-
-<p>or the following external Camel components</p>
-
-<ul><li><a shape="rect" class="external-link" href="http://scalate.fusesource.org/camel.html" rel="nofollow">Scalate</a></li></ul>
-
-
-<h3 id="Templating-Example">Example</h3>
-
-<p>Here's a simple example showing how we can respond to InOut requests on the <strong>My.Queue</strong> queue on <a shape="rect" href="activemq.html">ActiveMQ</a> with a template generated response. The reply would be sent back to the JMSReplyTo Destination.</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:My.Queue&quot;).
+<div class="wiki-content maincontent"><h2 id="Templating-Templating">Templating</h2><p>When you are testing distributed systems its a very common requirement to have to stub out certain external systems with some stub so that you can test other parts of the system until a specific system is available or written etc.</p><p>A great way to do this is using some kind of Template system to generate responses to requests generating a dynamic message using a mostly-static body.</p><p>There are a number of templating components included in the Camel distribution you could use</p><ul><li><a shape="rect" href="freemarker.html">FreeMarker</a></li><li><a shape="rect" href="mustache.html">Mustache</a></li><li><a shape="rect" href="stringtemplate.html">StringTemplate</a></li><li><a shape="rect" href="velocity.html">Velocity</a></li><li><a shape="rect" href="xquery.html">XQuery</a></li><li><a shape="rect" href="xslt.html">XSLT</a></li></ul><p>or the following external Camel components</p><ul><li><
 a shape="rect" class="external-link" href="http://scalate.fusesource.org/camel.html" rel="nofollow">Scalate</a></li></ul><h3 id="Templating-Example">Example</h3><p>Here's a simple example showing how we can respond to InOut requests on the <strong>My.Queue</strong> queue on <a shape="rect" href="activemq.html">ActiveMQ</a> with a template generated response. The reply would be sent back to the JMSReplyTo Destination.</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:My.Queue&quot;).
   to(&quot;velocity:com/acme/MyResponse.vm&quot;);
 ]]></script>
-</div></div>
-
-<p>If you want to use InOnly and consume the message and send it to another destination you could use</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:My.Queue&quot;).
+</div></div><p>If you want to use InOnly and consume the message and send it to another destination you could use</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:My.Queue&quot;).
   to(&quot;velocity:com/acme/MyResponse.vm&quot;).
   to(&quot;activemq:Another.Queue&quot;);
 ]]></script>
-</div></div>
-
-<h3 id="Templating-SeeAlso">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></div><h3 id="Templating-SeeAlso">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>
         </td>
         <td valign="top">
           <div class="navigation">

Modified: websites/production/camel/content/velocity.html
==============================================================================
--- websites/production/camel/content/velocity.html (original)
+++ websites/production/camel/content/velocity.html Fri Apr  1 14:19:01 2016
@@ -97,7 +97,7 @@
 </div></div><h3 id="Velocity-URIformat">URI format</h3><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[velocity:templateName[?options]
 ]]></script>
-</div></div><p>Where <strong>templateName</strong> is the classpath-local URI of the template to invoke; or the complete URL of the remote template (eg: <a shape="rect" class="external-link" href="file://folder/myfile.vm" rel="nofollow">file://folder/myfile.vm</a>).</p><p>You can append query options to the URI in the following format, <code>?option=value&amp;option=value&amp;...</code></p><h3 id="Velocity-Options">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>loaderCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Velocity based file loader cache.</
 p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>contentCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Cache for the resource content when it is loaded. <br clear="none" class="atl-forced-newline"> Note : as of Camel 2.9 cached resource content can be cleared via JMX using the endpoint's <code>clearContentCache</code> operation.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>encoding</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Character encoding of the resource content.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>propertiesFile</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>New option in Camel 2.1: The 
 URI of the properties file which is used for VelocityEngine initialization.</p></td></tr></tbody></table></div></div><h3 id="Velocity-MessageHeaders">Message Headers</h3><p>The velocity component sets a couple headers on the message (you can't set these yourself and from Camel 2.1 velocity component will not set these headers which will cause some side effect on the dynamic template support):</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelVelocityResourceUri</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The <strong>templateName</strong> as a <code>String</code> object.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>CamelVelocitySupplementalContext</code></td><td colspan="1" r
 owspan="1" class="confluenceTd"><p><strong>Camel 2.16:</strong> To add additional information to the used VelocityContext. The value of this header should be a <code>Map</code> with key/values that will added (override any existing key with the same name).<br clear="none">This can be used to pre setup some common key/values you want to reuse in your velocity endpoints.</p></td></tr></tbody></table></div></div><p>Headers set during the Velocity evaluation are returned to the message and added as headers. Then its kinda possible to return values from Velocity to the Message.</p><p>For example, to set the header value of <code>fruit</code> in the Velocity template <code>.tm</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Where <strong>templateName</strong> is the classpath-local URI of the template to invoke; or the complete URL of the remote template (eg: <a shape="rect" class="external-link" href="file://folder/myfile.vm" rel="nofollow">file://folder/myfile.vm</a>).</p><p>You can append query options to the URI in the following format, <code>?option=value&amp;option=value&amp;...</code></p><h3 id="Velocity-Options">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>loaderCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Velocity based file loader cache.</
 p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>contentCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Cache for the resource content when it is loaded. <br clear="none" class="atl-forced-newline"> Note : as of Camel 2.9 cached resource content can be cleared via JMX using the endpoint's <code>clearContentCache</code> operation.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>encoding</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Character encoding of the resource content.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>propertiesFile</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>New option in Camel 2.1: The 
 URI of the properties file which is used for VelocityEngine initialization.</p></td></tr></tbody></table></div></div><h3 id="Velocity-MessageHeaders">Message Headers</h3><p>The velocity component sets a couple headers on the message (you can't set these yourself and from Camel 2.1 velocity component will not set these headers which will cause some side effect on the dynamic template support):</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelVelocityResourceUri</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The <strong>templateName</strong> as a <code>String</code> object.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelVelocitySupplementalContext</code></p></td><td colspa
 n="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.16:</strong> To add additional information to the used VelocityContext. The value of this header should be a <code>Map</code> with key/values that will added (override any existing key with the same name).<br clear="none">This can be used to pre setup some common key/values you want to reuse in your velocity endpoints.</p></td></tr></tbody></table></div></div><p>Headers set during the Velocity evaluation are returned to the message and added as headers. Then its kinda possible to return values from Velocity to the Message.</p><p>For example, to set the header value of <code>fruit</code> in the Velocity template <code>.tm</code>:</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[$in.setHeader(&quot;fruit&quot;, &quot;Apple&quot;)
 ]]></script>
 </div></div><p>The <code>fruit</code> header is now accessible from the <code>message.out.headers</code>.</p><h3 id="Velocity-VelocityContext">Velocity Context</h3><p>Camel will provide exchange information in the Velocity context (just a <code>Map</code>). The <code>Exchange</code> is transfered as:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>key</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The <code>Exchange</code> itself.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>exchange.properties</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The <code>Exchange</code> properties.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>headers</c
 ode></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The headers of the In message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>camelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context instance.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>request</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The In message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>in</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The In message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>body</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The In message body.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>out</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Out message (only for InOut message exchange pattern).</p></td></tr><tr><
 td colspan="1" rowspan="1" class="confluenceTd"><p><code>response</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Out message (only for InOut message exchange pattern).</p></td></tr></tbody></table></div></div><p>Since Camel-2.14, you can setup a custom Velocity Context yourself by setting the message header <strong>CamelVelocityContext&#160;</strong>just like this</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">