Author: buildbot
Date: Mon Jul 13 10:20:36 2015
New Revision: 958101
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/book-in-one-page.html
websites/production/camel/content/book-pattern-appendix.html
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/content-enricher.html
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 Mon Jul 13 10:20:36
2015
@@ -3679,11 +3679,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> </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.rbtoc1436707111264 {padding: 0px;}
-div.rbtoc1436707111264 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1436707111264 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1436782718452 {padding: 0px;}
+div.rbtoc1436782718452 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1436782718452 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1436707111264">
+/*]]>*/</style></p><div class="toc-macro rbtoc1436782718452">
<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>
@@ -5783,11 +5783,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.rbtoc1436707112037 {padding: 0px;}
-div.rbtoc1436707112037 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1436707112037 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1436782718808 {padding: 0px;}
+div.rbtoc1436782718808 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1436782718808 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style><div class="toc-macro rbtoc1436707112037">
+/*]]>*/</style><div class="toc-macro rbtoc1436782718808">
<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>
@@ -15198,7 +15198,7 @@ from("direct:start").process(n
<to uri="activemq:Output"/>
</route>
]]></script>
-</div></div><p><span class="confluence-anchor-link"
id="BookInOnePage-enrich-dsl"></span></p><h3
id="BookInOnePage-ContentenrichmentusingtheenrichDSLelement">Content enrichment
using the <code>enrich</code> DSL element</h3><p>Camel comes with two flavors
of content enricher in the DSL</p><ul
class="alternate"><li><code>enrich</code></li><li><code>pollEnrich</code></li></ul><p><code>enrich</code>
uses a <code>Producer</code> to obtain the additional data. It is usually used
for <a shape="rect" href="request-reply.html">Request Reply</a> messaging, for
instance to invoke an external web service.<br clear="none">
<code>pollEnrich</code> on the other hand uses a <a shape="rect"
href="polling-consumer.html">Polling Consumer</a> to obtain the additional
data. It is usually used for <a shape="rect" href="event-message.html">Event
Message</a> messaging, for instance to read a file or download a <a
shape="rect" href="ftp2.html">FTP</a> file.</p><div
class="confluence-information-macro conflu
ence-information-macro-warning"><p class="title">Data from current Exchange
not used</p><span class="aui-icon aui-icon-small aui-iconfont-error
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p><code>pollEnrich</code> or
<code>enrich</code> does <strong>not</strong> access any data from the current
<a shape="rect" href="exchange.html">Exchange</a> which means when polling it
cannot use any of the existing headers you may have set on the <a shape="rect"
href="exchange.html">Exchange</a>. For example you cannot set a filename in the
<code>Exchange.FILE_NAME</code> header and use <code>pollEnrich</code> to
consume only that file. For that you <strong>must</strong> set the filename in
the endpoint URI.</p><p>Instead of using <code>enrich</code> you can use <a
shape="rect" href="recipient-list.html">Recipient List</a> and have dynamic
endpoints and define an <code>AggregationStrategy</code> on the <a shape="rect"
href="recipient-list.html">Recipi
ent List</a> which then would work as a <code>enrich</code> would
do.</p><p>pollEnrich only accept one message as response. That means that if
you target to enrich your original message with the enricher collecting
messages from a seda, ... components using an aggregation strategy. Only one
response message will be aggregated with the original
message</p><p> </p></div></div><h3 id="BookInOnePage-EnrichOptions">Enrich
Options</h3><div class="confluenceTableSmall"><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>Default Value</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>uri</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>The endpoint uri for the external service t
o enrich from. You must use either <code>uri</code> or
<code>ref</code>.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>ref</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Refers to the endpoint for the external service to
enrich from. You must use either <code>uri</code> or
<code>ref</code>.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyRef</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Refers to an <a shape="rect" class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/processor/aggregate/AggregationStrategy.html">AggregationStrategy</a>
to be used to merge the reply from the external service, into a single
outgoing message. By default Camel will use the reply from the external service
as outgoing mess
age. From <strong>Camel 2.12</strong> onwards you can also use a POJO as the
<code>AggregationStrategy</code>, see the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodName</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Camel 2.12:</strong> This option can be used to
explicit declare the method name to use, when using POJOs as the
<code>AggregationStrategy</code>. See the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodAllowNull</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> If
this option is <code>false</code> then the aggregate met
hod is not used if there was no data to enrich. If this option is
<code>true</code> then <code>null</code> values is used as the
<code>oldExchange</code> (when no data to enrich), when using POJOs as the
<code>AggregationStrategy</code>. See the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><code>aggregateOnException</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong> If this option is
<code>false</code> then the aggregate method is <strong>not</strong> used if
there was an exception thrown while trying to retrieve the data to enrich from
the resource. Setting this option to <code>true</code> allows end users to
control what to do if there was an exception in the <code>aggregate</code>
method. For example to suppress the exception or set a custom message body
etc.</td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd"><code>shareUnitOfWork</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong> <span
style="color: rgb(0,0,0);"> Shares the unit of work with the parent and
the resource exchange. Enrich will by default not share unit of work between
the parent exchange and the resource exchange. This means the resource exchange
has its own individual unit of work. See <a shape="rect"
href="splitter.html">Splitter</a> for more information and
example.</span></td></tr></tbody></table></div></div><p><strong>Using
the</strong> <strong><a shape="rect" href="fluent-builders.html">Fluent
Builders</a></strong></p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+</div></div><p><span class="confluence-anchor-link"
id="BookInOnePage-enrich-dsl"></span></p><h3
id="BookInOnePage-ContentenrichmentusingtheenrichDSLelement">Content enrichment
using the <code>enrich</code> DSL element</h3><p>Camel comes with two flavors
of content enricher in the DSL</p><ul
class="alternate"><li><code>enrich</code></li><li><code>pollEnrich</code></li></ul><p><code>enrich</code>
uses a <code>Producer</code> to obtain the additional data. It is usually used
for <a shape="rect" href="request-reply.html">Request Reply</a> messaging, for
instance to invoke an external web service.<br clear="none">
<code>pollEnrich</code> on the other hand uses a <a shape="rect"
href="polling-consumer.html">Polling Consumer</a> to obtain the additional
data. It is usually used for <a shape="rect" href="event-message.html">Event
Message</a> messaging, for instance to read a file or download a <a
shape="rect" href="ftp2.html">FTP</a> file.</p><div
class="confluence-information-macro conflu
ence-information-macro-warning"><p class="title">Camel 2.15 or older - Data
from current Exchange not used</p><span class="aui-icon aui-icon-small
aui-iconfont-error confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p><code>pollEnrich</code> or
<code>enrich</code> does <strong>not</strong> access any data from the current
<a shape="rect" href="exchange.html">Exchange</a> which means when polling it
cannot use any of the existing headers you may have set on the <a shape="rect"
href="exchange.html">Exchange</a>. For example you cannot set a filename in the
<code>Exchange.FILE_NAME</code> header and use <code>pollEnrich</code> to
consume only that file. For that you <strong>must</strong> set the filename in
the endpoint URI.</p><p>Instead of using <code>enrich</code> you can use <a
shape="rect" href="recipient-list.html">Recipient List</a> and have dynamic
endpoints and define an <code>AggregationStrategy</code> on the <a shape="rect"
href="recip
ient-list.html">Recipient List</a> which then would work as a
<code>enrich</code> would do.</p><p>pollEnrich only accept one message as
response. That means that if you target to enrich your original message with
the enricher collecting messages from a seda, ... components using an
aggregation strategy. Only one response message will be aggregated with the
original message.</p><p>From <strong>Camel 2.16</strong> onwards both enrich
and pollEnrich supports dynamic endpoints that uses an <a shape="rect"
href="expression.html">Expression</a> to compute the uri, which allows to use
data from the current <a shape="rect" href="exchange.html">Exchange</a>. In
other words all what is told above no longer apply and it just
works.</p></div></div><h3 id="BookInOnePage-EnrichOptions">Enrich
Options</h3><div class="confluenceTableSmall"><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" cl
ass="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>uri</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>The endpoint uri for the external service to enrich
from. You must use either <code>uri</code> or <code>ref</code>.
<strong>Important:</strong> From Camel 2.16 onwards, this option is removed,
and you use an <a shape="rect" href="expression.html">Expression</a> to
configure the uri, such as <a shape="rect" href="simple.html">Simple</a> or <a
shape="rect" href="constant.html">Constant</a> or any other dynamic language
that can compute the uri dynamically using values from the current <a
shape="rect" href="exchange.html">Exchange</a>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>ref</code></p></td><td
colspan="1" rowspan="1" class="confluen
ceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Refers to the endpoint for the external service to
enrich from. You must use either <code>uri</code> or <code>ref</code>.
<span> </span><strong>Important:</strong><span> From Camel 2.16 onwards,
this option is removed, and you use an </span><a shape="rect"
href="expression.html">Expression</a><span> to configure the uri, such as
</span><a shape="rect" href="simple.html">Simple</a><span> or </span><a
shape="rect" href="constant.html">Constant</a><span> or any other dynamic
language that can compute the uri dynamically using values from the current
</span><span> </span><a shape="rect"
href="exchange.html">Exchange</a><span>.</span></p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">expression</td><td colspan="1"
rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd"><strong>Camel 2.16:</strong> Mandatory.
The<span> </span><a shape="rect" href=
"expression.html">Expression</a><span> to configure the uri, such as </span><a
shape="rect" href="simple.html">Simple</a><span> or </span><a shape="rect"
href="constant.html">Constant</a><span> or any other dynamic language that can
compute the uri dynamically using values from the current
</span><span> </span><a shape="rect"
href="exchange.html">Exchange</a><span>.</span></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>strategyRef</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Refers to an <a shape="rect"
class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/processor/aggregate/AggregationStrategy.html">AggregationStrategy</a>
to be used to merge the reply from the external service, into a single
outgoing message. By default Camel will use the reply from the external service
as outgoing message. From <strong>Camel 2.12</s
trong> onwards you can also use a POJO as the
<code>AggregationStrategy</code>, see the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodName</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Camel 2.12:</strong> This option can be used to
explicit declare the method name to use, when using POJOs as the
<code>AggregationStrategy</code>. See the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodAllowNull</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> If
this option is <code>false</code> then the aggregate method is not used if
there was no
data to enrich. If this option is <code>true</code> then <code>null</code>
values is used as the <code>oldExchange</code> (when no data to enrich), when
using POJOs as the <code>AggregationStrategy</code>. See the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><code>aggregateOnException</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong> If this option is
<code>false</code> then the aggregate method is <strong>not</strong> used if
there was an exception thrown while trying to retrieve the data to enrich from
the resource. Setting this option to <code>true</code> allows end users to
control what to do if there was an exception in the <code>aggregate</code>
method. For example to suppress the exception or set a custom message body
etc.</td></tr><tr><td colspan="1" rowspan="1" class=
"confluenceTd"><code>shareUnitOfWork</code></td><td colspan="1" rowspan="1"
class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1"
class="confluenceTd"><strong>Camel 2.16:</strong> <span style="color:
rgb(0,0,0);"> Shares the unit of work with the parent and the resource
exchange. Enrich will by default not share unit of work between the parent
exchange and the resource exchange. This means the resource exchange has its
own individual unit of work. See <a shape="rect"
href="splitter.html">Splitter</a> for more information and
example.</span></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><code>cacheSize</code></td><td colspan="1" rowspan="1"
class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd"><strong>Camel 2.16:</strong> <span style="color:
rgb(0,0,0);">Allows to configure the cache size for
the </span><code>ProducerCache</code><span style="color:
rgb(0,0,0);"> which caches producers for reuse in the enrich.
Will by default use the default cache size which is 1000. Setting the value
to -1 allows to turn off the cache all
together.</span></td></tr></tbody></table></div></div><p><strong>Using
the</strong> <strong><a shape="rect" href="fluent-builders.html">Fluent
Builders</a></strong></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[AggregationStrategy aggregationStrategy = ...
from("direct:start")
@@ -15252,7 +15252,7 @@ from("direct:resource")
<to uri="direct:result"/>
</route>
]]></script>
-</div></div><h3 id="BookInOnePage-ContentenrichmentusingpollEnrich">Content
enrichment using <code>pollEnrich</code></h3><p>The <code>pollEnrich</code>
works just as the <code>enrich</code> however as it uses a <a shape="rect"
href="polling-consumer.html">Polling Consumer</a> we have 3 methods when
polling</p><ul
class="alternate"><li>receive</li><li>receiveNoWait</li><li>receive(timeout)</li></ul><h3
id="BookInOnePage-PollEnrichOptions">PollEnrich Options</h3><div
class="confluenceTableSmall"><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>Default Value</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>uri</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>The endpoint uri
for the external service to enrich from. You must use either <code>uri</code>
or <code>ref</code>.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>ref</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Refers to the endpoint for the external service to
enrich from. You must use either <code>uri</code> or
<code>ref</code>.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyRef</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Refers to an <a shape="rect" class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/processor/aggregate/AggregationStrategy.html">AggregationStrategy</a>
to be used to merge the reply from the external service, into a single
outgoing message. By default Camel will use the reply from the extern
al service as outgoing message. From <strong>Camel 2.12</strong> onwards you
can also use a POJO as the <code>AggregationStrategy</code>, see the <a
shape="rect" href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodName</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Camel 2.12:</strong> This option can be used to
explicit declare the method name to use, when using POJOs as the
<code>AggregationStrategy</code>. See the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodAllowNull</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> If
this option is <code>false</c
ode> then the aggregate method is not used if there was no data to enrich. If
this option is <code>true</code> then <code>null</code> values is used as the
<code>oldExchange</code> (when no data to enrich), when using POJOs as the
<code>AggregationStrategy</code>. See the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>timeout</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>-1</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Timeout in millis when polling from the
external service. See below for important details about the
timeout.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><code>aggregateOnException</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong> If this option is
<code>false</code> then the aggregate me
thod is <strong>not</strong> used if there was an exception thrown while
trying to retrieve the data to enrich from the resource. Setting this option to
<code>true</code> allows end users to control what to do if there was an
exception in the <code>aggregate</code> method. For example to suppress the
exception or set a custom message body
etc.</td></tr></tbody></table></div></div><div
class="confluence-information-macro
confluence-information-macro-information"><p class="title">Good practice to use
timeout value</p><span class="aui-icon aui-icon-small aui-iconfont-info
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>By default Camel will use the
<code>receive</code>. Which may block until there is a message available. It is
therefore recommended to always provide a timeout value, to make this clear
that we may wait for a message, until the timeout is hit.</p></div></div><p>If
there is no data then the <code>newExchange</code> in the aggreg
ation strategy is <code>null</code>.</p><p>You can pass in a timeout value
that determines which method to use</p><ul class="alternate"><li>if timeout is
-1 or other negative number then <code>receive</code> is selected
(<strong>Important:</strong> the <code>receive</code> method may block if there
is no message)</li><li>if timeout is 0 then <code>receiveNoWait</code> is
selected</li><li>otherwise <code>receive(timeout)</code> is
selected</li></ul><p>The timeout values is in millis.</p><div
class="confluence-information-macro confluence-information-macro-warning"><p
class="title">Data from current Exchange not used</p><span class="aui-icon
aui-icon-small aui-iconfont-error
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p><code>pollEnrich</code> does
<strong>not</strong> access any data from the current <a shape="rect"
href="exchange.html">Exchange</a> which means when polling it cannot use any of
the existing headers you may have set on the
<a shape="rect" href="exchange.html">Exchange</a>. For example you cannot set
a filename in the <code>Exchange.FILE_NAME</code> header and use
<code>pollEnrich</code> to consume only that file. For that you
<strong>must</strong> set the filename in the endpoint URI.</p></div></div><h4
id="BookInOnePage-Example.11">Example</h4><p>In this example we enrich the
message by loading the content from the file named inbox/data.txt.</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><h3 id="BookInOnePage-ContentenrichmentusingpollEnrich">Content
enrichment using <code>pollEnrich</code></h3><p>The <code>pollEnrich</code>
works just as the <code>enrich</code> however as it uses a <a shape="rect"
href="polling-consumer.html">Polling Consumer</a> we have 3 methods when
polling</p><ul
class="alternate"><li>receive</li><li>receiveNoWait</li><li>receive(timeout)</li></ul><h3
id="BookInOnePage-PollEnrichOptions">PollEnrich Options</h3><div
class="confluenceTableSmall"><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>Default Value</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>uri</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>The endpoint uri
for the external service to enrich from. You must use either <code>uri</code>
or <code>ref</code>. <strong>Important:</strong><span> From Camel 2.16 onwards,
this option is removed, and you use an </span><a shape="rect"
href="expression.html">Expression</a><span> to configure the uri, such as
</span><a shape="rect" href="simple.html">Simple</a><span> or </span><a
shape="rect" href="constant.html">Constant</a><span> or any other dynamic
language that can compute the uri dynamically using values from the current
</span><span> </span><a shape="rect"
href="exchange.html">Exchange</a><span>.</span></p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>ref</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Refers to the endpoint for the external
service to enrich from. You must use either <code>uri</code> or
<code>ref</code>. <strong>Important:</strong><span> From Camel 2.16 onwar
ds, this option is removed, and you use an </span><a shape="rect"
href="expression.html">Expression</a><span> to configure the uri, such as
</span><a shape="rect" href="simple.html">Simple</a><span> or </span><a
shape="rect" href="constant.html">Constant</a><span> or any other dynamic
language that can compute the uri dynamically using values from the current
</span><span> </span><a shape="rect"
href="exchange.html">Exchange</a><span>.</span></p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>expression</code></td><td
colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong><span> Mandatory.
The</span><span> </span><a shape="rect"
href="expression.html">Expression</a><span> to configure the uri, such as
</span><a shape="rect" href="simple.html">Simple</a><span> or </span><a
shape="rect" href="constant.html">Constant</a><span> or any other dynamic
language that can compute the u
ri dynamically using values from the current </span><span> </span><a
shape="rect" href="exchange.html">Exchange</a><span>.</span></td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyRef</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Refers to an <a shape="rect" class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/processor/aggregate/AggregationStrategy.html">AggregationStrategy</a>
to be used to merge the reply from the external service, into a single
outgoing message. By default Camel will use the reply from the external service
as outgoing message. From <strong>Camel 2.12</strong> onwards you can also use
a POJO as the <code>AggregationStrategy</code>, see the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strate
gyMethodName</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Camel 2.12:</strong> This option can be used to
explicit declare the method name to use, when using POJOs as the
<code>AggregationStrategy</code>. See the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodAllowNull</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> If
this option is <code>false</code> then the aggregate method is not used if
there was no data to enrich. If this option is <code>true</code> then
<code>null</code> values is used as the <code>oldExchange</code> (when no data
to enrich), when using POJOs as the <code>AggregationStrategy</code>. See the
<a shape="rect" href="aggregato
r2.html">Aggregate</a> page for more details.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>timeout</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>-1</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Timeout in millis when polling
from the external service. See below for important details about the
timeout.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><code>aggregateOnException</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong> If this option is
<code>false</code> then the aggregate method is <strong>not</strong> used if
there was an exception thrown while trying to retrieve the data to enrich from
the resource. Setting this option to <code>true</code> allows end users to
control what to do if there was an exception in the <code>aggregate</code>
method. For example to suppress the ex
ception or set a custom message body etc.</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><code>cacheSize</code></td><td colspan="1"
rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd"><strong>Camel 2.16:</strong> <span style="color:
rgb(0,0,0);">Allows to configure the cache size for
the </span><code>ConsumerCache</code><span style="color:
rgb(0,0,0);"> which caches consumers for reuse in the pollEnrich. Will by
default use the default cache size which is 1000. Setting the value to -1
allows to turn off the cache all
together.</span></td></tr></tbody></table></div></div><div
class="confluence-information-macro
confluence-information-macro-information"><p class="title">Good practice to use
timeout value</p><span class="aui-icon aui-icon-small aui-iconfont-info
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>By default Camel will use the
<code>receive</code>. Which may block u
ntil there is a message available. It is therefore recommended to always
provide a timeout value, to make this clear that we may wait for a message,
until the timeout is hit.</p></div></div><p>If there is no data then the
<code>newExchange</code> in the aggregation strategy is
<code>null</code>.</p><p>You can pass in a timeout value that determines which
method to use</p><ul class="alternate"><li>if timeout is -1 or other negative
number then <code>receive</code> is selected (<strong>Important:</strong> the
<code>receive</code> method may block if there is no message)</li><li>if
timeout is 0 then <code>receiveNoWait</code> is selected</li><li>otherwise
<code>receive(timeout)</code> is selected</li></ul><p>The timeout values is in
millis.</p><div class="confluence-information-macro
confluence-information-macro-warning"><p class="title">Camel 2.15 or older -
Data from current Exchange not used</p><span class="aui-icon aui-icon-small
aui-iconfont-error confluence-information-macro-icon
"></span><div
class="confluence-information-macro-body"><p><code>pollEnrich</code> does
<strong>not</strong> access any data from the current <a shape="rect"
href="exchange.html">Exchange</a> which means when polling it cannot use any of
the existing headers you may have set on the <a shape="rect"
href="exchange.html">Exchange</a>. For example you cannot set a filename in the
<code>Exchange.FILE_NAME</code> header and use <code>pollEnrich</code> to
consume only that file. For that you <strong>must</strong> set the filename in
the endpoint URI.</p><p><span>From </span><strong>Camel 2.16</strong><span>
onwards both enrich and pollEnrich supports dynamic endpoints that uses an
</span><a shape="rect" href="expression.html">Expression</a><span> to compute
the uri, which allows to use data from the current </span><a shape="rect"
href="exchange.html">Exchange</a><span>. In other words all what is told above
no longer apply and it just works.</span></p></div></div><h4
id="BookInOnePage-Exam
ple.11">Example</h4><p>In this example we enrich the message by loading the
content from the file named inbox/data.txt.</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("direct:start")
.pollEnrich("file:inbox?fileName=data.txt")
.to("direct:result");
@@ -17678,11 +17678,11 @@ template.send("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.rbtoc1436707128431 {padding: 0px;}
-div.rbtoc1436707128431 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1436707128431 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1436782731891 {padding: 0px;}
+div.rbtoc1436782731891 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1436782731891 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1436707128431">
+/*]]>*/</style></p><div class="toc-macro rbtoc1436782731891">
<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>
Modified: websites/production/camel/content/book-pattern-appendix.html
==============================================================================
--- websites/production/camel/content/book-pattern-appendix.html (original)
+++ websites/production/camel/content/book-pattern-appendix.html Mon Jul 13
10:20:36 2015
@@ -3418,7 +3418,7 @@ from("direct:start").process(n
<to uri="activemq:Output"/>
</route>
]]></script>
-</div></div><p><span class="confluence-anchor-link"
id="BookPatternAppendix-enrich-dsl"></span></p><h3
id="BookPatternAppendix-ContentenrichmentusingtheenrichDSLelement">Content
enrichment using the <code>enrich</code> DSL element</h3><p>Camel comes with
two flavors of content enricher in the DSL</p><ul
class="alternate"><li><code>enrich</code></li><li><code>pollEnrich</code></li></ul><p><code>enrich</code>
uses a <code>Producer</code> to obtain the additional data. It is usually used
for <a shape="rect" href="request-reply.html">Request Reply</a> messaging, for
instance to invoke an external web service.<br clear="none">
<code>pollEnrich</code> on the other hand uses a <a shape="rect"
href="polling-consumer.html">Polling Consumer</a> to obtain the additional
data. It is usually used for <a shape="rect" href="event-message.html">Event
Message</a> messaging, for instance to read a file or download a <a
shape="rect" href="ftp2.html">FTP</a> file.</p><div
class="confluence-information-
macro confluence-information-macro-warning"><p class="title">Data from current
Exchange not used</p><span class="aui-icon aui-icon-small aui-iconfont-error
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p><code>pollEnrich</code> or
<code>enrich</code> does <strong>not</strong> access any data from the current
<a shape="rect" href="exchange.html">Exchange</a> which means when polling it
cannot use any of the existing headers you may have set on the <a shape="rect"
href="exchange.html">Exchange</a>. For example you cannot set a filename in the
<code>Exchange.FILE_NAME</code> header and use <code>pollEnrich</code> to
consume only that file. For that you <strong>must</strong> set the filename in
the endpoint URI.</p><p>Instead of using <code>enrich</code> you can use <a
shape="rect" href="recipient-list.html">Recipient List</a> and have dynamic
endpoints and define an <code>AggregationStrategy</code> on the <a shape="rect"
href="recipient-list.
html">Recipient List</a> which then would work as a <code>enrich</code> would
do.</p><p>pollEnrich only accept one message as response. That means that if
you target to enrich your original message with the enricher collecting
messages from a seda, ... components using an aggregation strategy. Only one
response message will be aggregated with the original
message</p><p> </p></div></div><h3
id="BookPatternAppendix-EnrichOptions">Enrich Options</h3><div
class="confluenceTableSmall"><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>Default Value</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>uri</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>The endpoint uri for the
external service to enrich from. You must use either <code>uri</code> or
<code>ref</code>.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>ref</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Refers to the endpoint for the external service to
enrich from. You must use either <code>uri</code> or
<code>ref</code>.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyRef</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Refers to an <a shape="rect" class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/processor/aggregate/AggregationStrategy.html">AggregationStrategy</a>
to be used to merge the reply from the external service, into a single
outgoing message. By default Camel will use the reply from the external servic
e as outgoing message. From <strong>Camel 2.12</strong> onwards you can also
use a POJO as the <code>AggregationStrategy</code>, see the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodName</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Camel 2.12:</strong> This option can be used to
explicit declare the method name to use, when using POJOs as the
<code>AggregationStrategy</code>. See the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodAllowNull</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> If
this option is <code>false</code> then
the aggregate method is not used if there was no data to enrich. If this
option is <code>true</code> then <code>null</code> values is used as the
<code>oldExchange</code> (when no data to enrich), when using POJOs as the
<code>AggregationStrategy</code>. See the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><code>aggregateOnException</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong> If this option is
<code>false</code> then the aggregate method is <strong>not</strong> used if
there was an exception thrown while trying to retrieve the data to enrich from
the resource. Setting this option to <code>true</code> allows end users to
control what to do if there was an exception in the <code>aggregate</code>
method. For example to suppress the exception or set a custom message body etc
.</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><code>shareUnitOfWork</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong> <span
style="color: rgb(0,0,0);"> Shares the unit of work with the parent and
the resource exchange. Enrich will by default not share unit of work between
the parent exchange and the resource exchange. This means the resource exchange
has its own individual unit of work. See <a shape="rect"
href="splitter.html">Splitter</a> for more information and
example.</span></td></tr></tbody></table></div></div><p><strong>Using
the</strong> <strong><a shape="rect" href="fluent-builders.html">Fluent
Builders</a></strong></p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+</div></div><p><span class="confluence-anchor-link"
id="BookPatternAppendix-enrich-dsl"></span></p><h3
id="BookPatternAppendix-ContentenrichmentusingtheenrichDSLelement">Content
enrichment using the <code>enrich</code> DSL element</h3><p>Camel comes with
two flavors of content enricher in the DSL</p><ul
class="alternate"><li><code>enrich</code></li><li><code>pollEnrich</code></li></ul><p><code>enrich</code>
uses a <code>Producer</code> to obtain the additional data. It is usually used
for <a shape="rect" href="request-reply.html">Request Reply</a> messaging, for
instance to invoke an external web service.<br clear="none">
<code>pollEnrich</code> on the other hand uses a <a shape="rect"
href="polling-consumer.html">Polling Consumer</a> to obtain the additional
data. It is usually used for <a shape="rect" href="event-message.html">Event
Message</a> messaging, for instance to read a file or download a <a
shape="rect" href="ftp2.html">FTP</a> file.</p><div
class="confluence-information-
macro confluence-information-macro-warning"><p class="title">Camel 2.15 or
older - Data from current Exchange not used</p><span class="aui-icon
aui-icon-small aui-iconfont-error
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p><code>pollEnrich</code> or
<code>enrich</code> does <strong>not</strong> access any data from the current
<a shape="rect" href="exchange.html">Exchange</a> which means when polling it
cannot use any of the existing headers you may have set on the <a shape="rect"
href="exchange.html">Exchange</a>. For example you cannot set a filename in the
<code>Exchange.FILE_NAME</code> header and use <code>pollEnrich</code> to
consume only that file. For that you <strong>must</strong> set the filename in
the endpoint URI.</p><p>Instead of using <code>enrich</code> you can use <a
shape="rect" href="recipient-list.html">Recipient List</a> and have dynamic
endpoints and define an <code>AggregationStrategy</code> on the <a shape="rect"
href="recipient-list.html">Recipient List</a> which then would work as a
<code>enrich</code> would do.</p><p>pollEnrich only accept one message as
response. That means that if you target to enrich your original message with
the enricher collecting messages from a seda, ... components using an
aggregation strategy. Only one response message will be aggregated with the
original message.</p><p>From <strong>Camel 2.16</strong> onwards both enrich
and pollEnrich supports dynamic endpoints that uses an <a shape="rect"
href="expression.html">Expression</a> to compute the uri, which allows to use
data from the current <a shape="rect" href="exchange.html">Exchange</a>. In
other words all what is told above no longer apply and it just
works.</p></div></div><h3 id="BookPatternAppendix-EnrichOptions">Enrich
Options</h3><div class="confluenceTableSmall"><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>Default Value</p></th><th colspan="1"
rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>uri</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>The endpoint uri for the external service
to enrich from. You must use either <code>uri</code> or <code>ref</code>.
<strong>Important:</strong> From Camel 2.16 onwards, this option is removed,
and you use an <a shape="rect" href="expression.html">Expression</a> to
configure the uri, such as <a shape="rect" href="simple.html">Simple</a> or <a
shape="rect" href="constant.html">Constant</a> or any other dynamic language
that can compute the uri dynamically using values from the current <a
shape="rect" href="exchange.html">Exchange</a>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>ref</code></p></td><td
colspan="1" rowspan="
1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Refers to the endpoint for the external service to
enrich from. You must use either <code>uri</code> or <code>ref</code>.
<span> </span><strong>Important:</strong><span> From Camel 2.16 onwards,
this option is removed, and you use an </span><a shape="rect"
href="expression.html">Expression</a><span> to configure the uri, such as
</span><a shape="rect" href="simple.html">Simple</a><span> or </span><a
shape="rect" href="constant.html">Constant</a><span> or any other dynamic
language that can compute the uri dynamically using values from the current
</span><span> </span><a shape="rect"
href="exchange.html">Exchange</a><span>.</span></p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">expression</td><td colspan="1"
rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd"><strong>Camel 2.16:</strong> Mandatory.
The<span> </span><a
shape="rect" href="expression.html">Expression</a><span> to configure the uri,
such as </span><a shape="rect" href="simple.html">Simple</a><span> or </span><a
shape="rect" href="constant.html">Constant</a><span> or any other dynamic
language that can compute the uri dynamically using values from the current
</span><span> </span><a shape="rect"
href="exchange.html">Exchange</a><span>.</span></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>strategyRef</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Refers to an <a shape="rect"
class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/processor/aggregate/AggregationStrategy.html">AggregationStrategy</a>
to be used to merge the reply from the external service, into a single
outgoing message. By default Camel will use the reply from the external service
as outgoing message. From <st
rong>Camel 2.12</strong> onwards you can also use a POJO as the
<code>AggregationStrategy</code>, see the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodName</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Camel 2.12:</strong> This option can be used to
explicit declare the method name to use, when using POJOs as the
<code>AggregationStrategy</code>. See the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodAllowNull</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> If
this option is <code>false</code> then the aggregate method is not us
ed if there was no data to enrich. If this option is <code>true</code> then
<code>null</code> values is used as the <code>oldExchange</code> (when no data
to enrich), when using POJOs as the <code>AggregationStrategy</code>. See the
<a shape="rect" href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><code>aggregateOnException</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong> If this option is
<code>false</code> then the aggregate method is <strong>not</strong> used if
there was an exception thrown while trying to retrieve the data to enrich from
the resource. Setting this option to <code>true</code> allows end users to
control what to do if there was an exception in the <code>aggregate</code>
method. For example to suppress the exception or set a custom message body
etc.</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><code>shareUnitOfWork</code></td><td
colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td
colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong> <span
style="color: rgb(0,0,0);"> Shares the unit of work with the parent and
the resource exchange. Enrich will by default not share unit of work between
the parent exchange and the resource exchange. This means the resource exchange
has its own individual unit of work. See <a shape="rect"
href="splitter.html">Splitter</a> for more information and
example.</span></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><code>cacheSize</code></td><td colspan="1" rowspan="1"
class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd"><strong>Camel 2.16:</strong> <span style="color:
rgb(0,0,0);">Allows to configure the cache size for
the </span><code>ProducerCache</code><span style="color:
rgb(0,0,0);"> which caches producers for re
use in the enrich. Will by default use the default cache size which is 1000.
Setting the value to -1 allows to turn off the cache all
together.</span></td></tr></tbody></table></div></div><p><strong>Using
the</strong> <strong><a shape="rect" href="fluent-builders.html">Fluent
Builders</a></strong></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[AggregationStrategy aggregationStrategy = ...
from("direct:start")
@@ -3472,7 +3472,7 @@ from("direct:resource")
<to uri="direct:result"/>
</route>
]]></script>
-</div></div><h3
id="BookPatternAppendix-ContentenrichmentusingpollEnrich">Content enrichment
using <code>pollEnrich</code></h3><p>The <code>pollEnrich</code> works just as
the <code>enrich</code> however as it uses a <a shape="rect"
href="polling-consumer.html">Polling Consumer</a> we have 3 methods when
polling</p><ul
class="alternate"><li>receive</li><li>receiveNoWait</li><li>receive(timeout)</li></ul><h3
id="BookPatternAppendix-PollEnrichOptions">PollEnrich Options</h3><div
class="confluenceTableSmall"><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>Default Value</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>uri</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>The
endpoint uri for the external service to enrich from. You must use either
<code>uri</code> or <code>ref</code>.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>ref</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Refers to the endpoint for the external service to
enrich from. You must use either <code>uri</code> or
<code>ref</code>.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyRef</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Refers to an <a shape="rect" class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/processor/aggregate/AggregationStrategy.html">AggregationStrategy</a>
to be used to merge the reply from the external service, into a single
outgoing message. By default Camel will use the reply fro
m the external service as outgoing message. From <strong>Camel 2.12</strong>
onwards you can also use a POJO as the <code>AggregationStrategy</code>, see
the <a shape="rect" href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodName</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Camel 2.12:</strong> This option can be used to
explicit declare the method name to use, when using POJOs as the
<code>AggregationStrategy</code>. See the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodAllowNull</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> If
this option is <c
ode>false</code> then the aggregate method is not used if there was no data to
enrich. If this option is <code>true</code> then <code>null</code> values is
used as the <code>oldExchange</code> (when no data to enrich), when using POJOs
as the <code>AggregationStrategy</code>. See the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>timeout</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>-1</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Timeout in millis when polling from the
external service. See below for important details about the
timeout.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><code>aggregateOnException</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong> If this option is
<code>false</code> then the
aggregate method is <strong>not</strong> used if there was an exception thrown
while trying to retrieve the data to enrich from the resource. Setting this
option to <code>true</code> allows end users to control what to do if there was
an exception in the <code>aggregate</code> method. For example to suppress the
exception or set a custom message body
etc.</td></tr></tbody></table></div></div><div
class="confluence-information-macro
confluence-information-macro-information"><p class="title">Good practice to use
timeout value</p><span class="aui-icon aui-icon-small aui-iconfont-info
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>By default Camel will use the
<code>receive</code>. Which may block until there is a message available. It is
therefore recommended to always provide a timeout value, to make this clear
that we may wait for a message, until the timeout is hit.</p></div></div><p>If
there is no data then the <code>newExchange</code> i
n the aggregation strategy is <code>null</code>.</p><p>You can pass in a
timeout value that determines which method to use</p><ul
class="alternate"><li>if timeout is -1 or other negative number then
<code>receive</code> is selected (<strong>Important:</strong> the
<code>receive</code> method may block if there is no message)</li><li>if
timeout is 0 then <code>receiveNoWait</code> is selected</li><li>otherwise
<code>receive(timeout)</code> is selected</li></ul><p>The timeout values is in
millis.</p><div class="confluence-information-macro
confluence-information-macro-warning"><p class="title">Data from current
Exchange not used</p><span class="aui-icon aui-icon-small aui-iconfont-error
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p><code>pollEnrich</code> does
<strong>not</strong> access any data from the current <a shape="rect"
href="exchange.html">Exchange</a> which means when polling it cannot use any of
the existing headers you may hav
e set on the <a shape="rect" href="exchange.html">Exchange</a>. For example
you cannot set a filename in the <code>Exchange.FILE_NAME</code> header and use
<code>pollEnrich</code> to consume only that file. For that you
<strong>must</strong> set the filename in the endpoint URI.</p></div></div><h4
id="BookPatternAppendix-Example.5">Example</h4><p>In this example we enrich the
message by loading the content from the file named inbox/data.txt.</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><h3
id="BookPatternAppendix-ContentenrichmentusingpollEnrich">Content enrichment
using <code>pollEnrich</code></h3><p>The <code>pollEnrich</code> works just as
the <code>enrich</code> however as it uses a <a shape="rect"
href="polling-consumer.html">Polling Consumer</a> we have 3 methods when
polling</p><ul
class="alternate"><li>receive</li><li>receiveNoWait</li><li>receive(timeout)</li></ul><h3
id="BookPatternAppendix-PollEnrichOptions">PollEnrich Options</h3><div
class="confluenceTableSmall"><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>Default Value</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>uri</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>The
endpoint uri for the external service to enrich from. You must use either
<code>uri</code> or <code>ref</code>. <strong>Important:</strong><span> From
Camel 2.16 onwards, this option is removed, and you use an </span><a
shape="rect" href="expression.html">Expression</a><span> to configure the uri,
such as </span><a shape="rect" href="simple.html">Simple</a><span> or </span><a
shape="rect" href="constant.html">Constant</a><span> or any other dynamic
language that can compute the uri dynamically using values from the current
</span><span> </span><a shape="rect"
href="exchange.html">Exchange</a><span>.</span></p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>ref</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Refers to the endpoint for the external
service to enrich from. You must use either <code>uri</code> or
<code>ref</code>. <strong>Important:</strong><span> From Came
l 2.16 onwards, this option is removed, and you use an </span><a shape="rect"
href="expression.html">Expression</a><span> to configure the uri, such as
</span><a shape="rect" href="simple.html">Simple</a><span> or </span><a
shape="rect" href="constant.html">Constant</a><span> or any other dynamic
language that can compute the uri dynamically using values from the current
</span><span> </span><a shape="rect"
href="exchange.html">Exchange</a><span>.</span></p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>expression</code></td><td
colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong><span> Mandatory.
The</span><span> </span><a shape="rect"
href="expression.html">Expression</a><span> to configure the uri, such as
</span><a shape="rect" href="simple.html">Simple</a><span> or </span><a
shape="rect" href="constant.html">Constant</a><span> or any other dynamic
language that can c
ompute the uri dynamically using values from the current
</span><span> </span><a shape="rect"
href="exchange.html">Exchange</a><span>.</span></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>strategyRef</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Refers to an <a shape="rect"
class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/processor/aggregate/AggregationStrategy.html">AggregationStrategy</a>
to be used to merge the reply from the external service, into a single
outgoing message. By default Camel will use the reply from the external service
as outgoing message. From <strong>Camel 2.12</strong> onwards you can also use
a POJO as the <code>AggregationStrategy</code>, see the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>strategyMethodName</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Camel 2.12:</strong> This option can be used to
explicit declare the method name to use, when using POJOs as the
<code>AggregationStrategy</code>. See the <a shape="rect"
href="aggregator2.html">Aggregate</a> page for more
details.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>strategyMethodAllowNull</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> If
this option is <code>false</code> then the aggregate method is not used if
there was no data to enrich. If this option is <code>true</code> then
<code>null</code> values is used as the <code>oldExchange</code> (when no data
to enrich), when using POJOs as the <code>AggregationStrategy</code>. See the
<a shape="rect" hre
f="aggregator2.html">Aggregate</a> page for more details.</p></td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>timeout</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>-1</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Timeout in millis when polling from the
external service. See below for important details about the
timeout.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><code>aggregateOnException</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong> If this option is
<code>false</code> then the aggregate method is <strong>not</strong> used if
there was an exception thrown while trying to retrieve the data to enrich from
the resource. Setting this option to <code>true</code> allows end users to
control what to do if there was an exception in the <code>aggregate</code>
method. For example to sup
press the exception or set a custom message body etc.</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><code>cacheSize</code></td><td
colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1"
rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong> <span
style="color: rgb(0,0,0);">Allows to configure the cache size for
the </span><code>ConsumerCache</code><span style="color:
rgb(0,0,0);"> which caches consumers for reuse in the pollEnrich. Will by
default use the default cache size which is 1000. Setting the value to -1
allows to turn off the cache all
together.</span></td></tr></tbody></table></div></div><div
class="confluence-information-macro
confluence-information-macro-information"><p class="title">Good practice to use
timeout value</p><span class="aui-icon aui-icon-small aui-iconfont-info
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>By default Camel will use the
<code>receive</code>. Which
may block until there is a message available. It is therefore recommended to
always provide a timeout value, to make this clear that we may wait for a
message, until the timeout is hit.</p></div></div><p>If there is no data then
the <code>newExchange</code> in the aggregation strategy is
<code>null</code>.</p><p>You can pass in a timeout value that determines which
method to use</p><ul class="alternate"><li>if timeout is -1 or other negative
number then <code>receive</code> is selected (<strong>Important:</strong> the
<code>receive</code> method may block if there is no message)</li><li>if
timeout is 0 then <code>receiveNoWait</code> is selected</li><li>otherwise
<code>receive(timeout)</code> is selected</li></ul><p>The timeout values is in
millis.</p><div class="confluence-information-macro
confluence-information-macro-warning"><p class="title">Camel 2.15 or older -
Data from current Exchange not used</p><span class="aui-icon aui-icon-small
aui-iconfont-error confluence-informatio
n-macro-icon"></span><div
class="confluence-information-macro-body"><p><code>pollEnrich</code> does
<strong>not</strong> access any data from the current <a shape="rect"
href="exchange.html">Exchange</a> which means when polling it cannot use any of
the existing headers you may have set on the <a shape="rect"
href="exchange.html">Exchange</a>. For example you cannot set a filename in the
<code>Exchange.FILE_NAME</code> header and use <code>pollEnrich</code> to
consume only that file. For that you <strong>must</strong> set the filename in
the endpoint URI.</p><p><span>From </span><strong>Camel 2.16</strong><span>
onwards both enrich and pollEnrich supports dynamic endpoints that uses an
</span><a shape="rect" href="expression.html">Expression</a><span> to compute
the uri, which allows to use data from the current </span><a shape="rect"
href="exchange.html">Exchange</a><span>. In other words all what is told above
no longer apply and it just works.</span></p></div></div><h4 id="BookPa
tternAppendix-Example.5">Example</h4><p>In this example we enrich the message
by loading the content from the file named inbox/data.txt.</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("direct:start")
.pollEnrich("file:inbox?fileName=data.txt")
.to("direct:result");
Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.