Author: buildbot Date: Fri Mar 10 18:20:17 2017 New Revision: 1008100 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/wire-tap.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 Fri Mar 10 18:20:17 2017 @@ -3542,11 +3542,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.rbtoc1489047633225 {padding: 0px;} -div.rbtoc1489047633225 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1489047633225 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1489169916376 {padding: 0px;} +div.rbtoc1489169916376 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1489169916376 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style></p><div class="toc-macro rbtoc1489047633225"> +/*]]>*/</style></p><div class="toc-macro rbtoc1489169916376"> <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> @@ -5661,11 +5661,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.rbtoc1489047634059 {padding: 0px;} -div.rbtoc1489047634059 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1489047634059 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1489169916549 {padding: 0px;} +div.rbtoc1489169916549 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1489169916549 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style><div class="toc-macro rbtoc1489047634059"> +/*]]>*/</style><div class="toc-macro rbtoc1489169916549"> <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> @@ -15778,7 +15778,7 @@ from("direct:start").choice() <h4 id="BookInOnePage-UsingThisPattern.46">Using This Pattern</h4> <p>If you would like to use this EIP Pattern then please read the <a shape="rect" href="getting-started.html">Getting Started</a>, you may also find the <a shape="rect" href="architecture.html">Architecture</a> useful particularly the description of <a shape="rect" href="endpoint.html">Endpoint</a> and <a shape="rect" href="uris.html">URIs</a>. Then you could try out some of the <a shape="rect" href="examples.html">Examples</a> first before trying this pattern out.</p> -<h3 id="BookInOnePage-WireTap">Wire Tap</h3><p><a shape="rect" class="external-link" href="http://www.enterpriseintegrationpatterns.com/WireTap.html" rel="nofollow">Wire Tap</a> (from the <a shape="rect" href="enterprise-integration-patterns.html">EIP patterns</a>) allows you to route messages to a separate location while they are being forwarded to the ultimate destination.</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://www.enterpriseintegrationpatterns.com/img/WireTap.gif" data-image-src="http://www.enterpriseintegrationpatterns.com/img/WireTap.gif"></span></p><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Streams</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>If you <a shape="rect" href="wire-tap.html">Wire Tap</a> a stream message body then you should consider enabling <a shape="rect" href="stream-caching.html">Stream caching</a> to ensure the message body can be read at each endpoint. See more details at <a shape="rect" href="stream-caching.html">Stream caching</a>.</p></div></div><h3 id="BookInOnePage-Options.20">Options</h3><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><strong>Mandatory:</strong> The URI of the endpoint to which the wire-tapped message will be sent. From <strong>Camel 2.16</strong> onwards support dynamic to uris like documented in <a shape="rect" class="external-link" hr ef="http://camel.apache.org/message-endpoint.html" style="line-height: 1.4285715;">Message Endpoint</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>executorServiceRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference identifier of a custom <a shape="rect" href="threading-model.html">Thread Pool</a> to use when processing the wire-tapped messages. If not set, Camel will use a default thread pool.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>processorRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference identifier of a custom <a shape="rect" href="processor.html">Processor</a> to use for creating a new message (e.g., the "send a new message" mode). See below.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>copy</c ode></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.3</strong>: Whether to copy the <a shape="rect" href="exchange.html">Exchange</a> before wire-tapping the message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>onPrepareRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8:</strong> Reference identifier of a custom <a shape="rect" href="processor.html">Processor</a> to prepare the copy of the <a shape="rect" href="exchange.html">Exchange</a> to be wire-tapped. This allows you to do any custom logic, such as deep-cloning the message payload.</p></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"><span st yle="color: rgb(0,0,0);"><strong>Camel 2.16:</strong> Allows to configure the cache size for the </span><code>ProducerCache</code><span style="color: rgb(0,0,0);"> which caches producers for reuse. 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><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>ignoreInvalidEndpoint</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);">Whether to ignore an endpoint URI that could not be resolved. If disabled, Camel will throw an exception identifying the invalid endpoint URI.</span></td></tr></tbody></table></div><h3 id="BookInOnePage-WireTapthreadpool">WireTap thread pool</h3><p>The <a shape="rect" href="wire-tap.html">Wire Tap</a> uses a thread pool to process the tapped messages. This thread pool wi ll by default use the settings detailed at <a shape="rect" href="threading-model.html">Threading Model</a>. In particular, when the pool is exhausted (with all threads utilized), further wiretaps will be executed synchronously by the calling thread. To remedy this, you can configure an explicit thread pool on the <a shape="rect" href="wire-tap.html">Wire Tap</a> having either a different rejection policy, a larger worker queue, or more worker threads.</p><h3 id="BookInOnePage-WireTapnode">WireTap node</h3><p>Camel's Wire Tap node supports two flavors when tapping an <a shape="rect" href="exchange.html">Exchange</a>:</p><p>-With the traditional Wire Tap, Camel will copy the original <a shape="rect" href="exchange.html">Exchange</a> and set its <a shape="rect" href="exchange-pattern.html">Exchange Pattern</a> to InOnly, as we want the tapped <a shape="rect" href="exchange.html">Exchange</a> to be sent in a fire and forget style. The tapped <a shape="rect" href="exchange.html">Exchange </a> is then sent in a separate thread so it can run in parallel with the original. Beware that only the Exchange is copied - Wire Tap won't do a deep clone (unless you specify a custom processor via <em>onPrepareRef</em> which does that). So all copies could share objects from the original Exchange.</p><p>-Camel also provides an option of sending a new <a shape="rect" href="exchange.html">Exchange</a> allowing you to populate it with new values.</p><h4 id="BookInOnePage-Sendingacopy(traditionalwiretap)">Sending a copy (traditional wiretap)</h4><p><strong>Using the <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"> +<h3 id="BookInOnePage-WireTap">Wire Tap</h3><p><a shape="rect" class="external-link" href="http://www.enterpriseintegrationpatterns.com/WireTap.html" rel="nofollow">Wire Tap</a> (from the <a shape="rect" href="enterprise-integration-patterns.html">EIP patterns</a>) allows you to route messages to a separate location while they are being forwarded to the ultimate destination.</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://www.enterpriseintegrationpatterns.com/img/WireTap.gif" data-image-src="http://www.enterpriseintegrationpatterns.com/img/WireTap.gif"></span></p><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Streams</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>If you <a shape="rect" href="wire-tap.html">Wire Tap</a> a stream message body then you should consider enabling <a shape="rect" href="stream-caching.html">Stream caching</a> to ensure the message body can be read at each endpoint. See more details at <a shape="rect" href="stream-caching.html">Stream caching</a>.</p></div></div><h3 id="BookInOnePage-Options.20">Options</h3><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">Name</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>uri</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong><span style="color: rgb(255,0,0);">Mandatory</span>:</strong> The URI of the endpoint to which the wire-tapped message should be sent.</p><p>From <strong>Camel 2.16</strong>: support for dynamic <strong><code>to</code></str ong> URIs is as documented in <a shape="rect" class="external-link" href="http://camel.apache.org/message-endpoint.html" style="line-height: 1.4285715;">Message Endpoint.</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>executorServiceRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference ID of a custom <a shape="rect" href="threading-model.html">Thread Pool</a> to use when processing the wire-tapped messages.</p><p>When not set, Camel will use an instance of the default thread pool.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>processorRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference ID of a custom <a shape="rect" href="processor.html">Processor</a> to use for creating a new message.</p><p>See "<strong>Sending a New Exchange</strong>" below.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>copy</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.3</strong>: Whether to copy the <a shape="rect" href="exchange.html">Exchange</a> before wire-tapping the message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>onPrepareRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8:</strong> Reference identifier of a custom <a shape="rect" href="processor.html">Processor</a> to prepare the copy of the <a shape="rect" href="exchange.html">Exchange</a> to be wire-tapped. This allows you to do any custom logic, such as deep-cloning the message payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>cacheSize</code></p></td><td colspan="1" rows pan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(0,0,0);"><strong>Camel 2.16:</strong> Allows to configure the cache size for the </span><strong><code>ProducerCache</code></strong><span style="color: rgb(0,0,0);"> which caches producers for reuse. Will by default use the default cache size which is <strong><code>1000</code></strong>. </span></p><p><span style="color: rgb(0,0,0);">Setting the value to <strong><code>-1</code></strong> allows to turn off the cache all together.</span></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ignoreInvalidEndpoint</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.16:</strong> <span style="color: rgb(0,0,0);">Whether to ignore an endpoint URI that could not be resolved. </span></p><p><span style="color: rgb(0,0,0);">When <strong>< code>false</code></strong>, Camel will throw an exception when it identifies an invalid endpoint URI.</span></p></td></tr></tbody></table></div><h3 id="BookInOnePage-WireTapThreadpool">WireTap Threadpool</h3><p>The <a shape="rect" href="wire-tap.html">Wire Tap</a> uses a thread pool to process the tapped messages. This thread pool will by default use the settings detailed at <a shape="rect" href="threading-model.html">Threading Model</a>. In particular, when the pool is exhausted (with all threads utilized), further wiretaps will be executed synchronously by the calling thread. To remedy this, you can configure an explicit thread pool on the <a shape="rect" href="wire-tap.html">Wire Tap</a> having either a different rejection policy, a larger worker queue, or more worker threads.</p><h3 id="BookInOnePage-WireTapNode">WireTap Node</h3><p>Camel's Wire Tap node supports two flavors when tapping an <a shape="rect" href="exchange.html">Exchange</a>:</p><ul><li>With the traditional Wire T ap, Camel will copy the original <a shape="rect" href="exchange.html">Exchange</a> and set its <a shape="rect" href="exchange-pattern.html">Exchange Pattern</a> to <strong><code>InOnly</code></strong>, as we want the tapped <a shape="rect" href="exchange.html">Exchange</a> to be sent in a fire and forget style. The tapped <a shape="rect" href="exchange.html">Exchange</a> is then sent in a separate thread so it can run in parallel with the original. Beware that only the Exchange is copied - Wire Tap won't do a deep clone (unless you specify a custom processor via <strong><code>onPrepareRef</code></strong> which does that). So all copies could share objects from the original Exchange.</li><li>Camel also provides an option of sending a new <a shape="rect" href="exchange.html">Exchange</a> allowing you to populate it with new values.</li></ul><h4 id="BookInOnePage-SendingaCopy(traditionalwiretap)">Sending a Copy (traditional wiretap)</h4><p><strong>Using the <a shape="rect" href="f luent-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[ from("direct:start") .to("log:foo") @@ -15794,7 +15794,7 @@ from("direct:start") <to uri="mock:result"/> </route> ]]></script> -</div></div><h4 id="BookInOnePage-Sendinganew">Sending a new <a shape="rect" href="exchange.html">Exchange</a></h4><p><strong>Using the <a shape="rect" href="fluent-builders.html">Fluent Builders</a></strong><br clear="none"> Camel supports either a processor or an <a shape="rect" href="expression.html">Expression</a> to populate the new <a shape="rect" href="exchange.html">Exchange</a>. Using a processor gives you full power over how the <a shape="rect" href="exchange.html">Exchange</a> is populated as you can set properties, headers, et cetera. An <a shape="rect" href="expression.html">Expression</a> can only be used to set the IN body.</p><p>From <strong>Camel 2.3</strong> onwards the <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="processor.html">Processor</a> is pre-populated with a copy of the original <a shape="rect" href="exchange.html">Exchange</a>, which allows you to access the original message when you prepare a new <a shape="rect" href="ex change.html">Exchange</a> to be sent. You can use the <code>copy</code> option (enabled by default) to indicate whether you want this. If you set <code>copy=false</code>, then it works as in Camel 2.2 or older where the <a shape="rect" href="exchange.html">Exchange</a> will be empty.</p><p>Below is the processor variation. This example is from Camel 2.3, where we disable <code>copy</code> by passing in <code>false</code> to create a new, empty <a shape="rect" href="exchange.html">Exchange</a>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="BookInOnePage-SendingaNew">Sending a New <a shape="rect" href="exchange.html">Exchange</a></h4><p><strong>Using the <a shape="rect" href="fluent-builders.html">Fluent Builders</a></strong><br clear="none"> Camel supports either a processor or an <a shape="rect" href="expression.html">Expression</a> to populate the new <a shape="rect" href="exchange.html">Exchange</a>. Using a processor gives you full power over how the <a shape="rect" href="exchange.html">Exchange</a> is populated as you can set properties, headers, etc. An <a shape="rect" href="expression.html">Expression</a> can only be used to set the <strong><code>IN</code></strong> body.</p><p>From <strong>Camel 2.3</strong>: the <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="processor.html">Processor</a> is pre-populated with a copy of the original <a shape="rect" href="exchange.html">Exchange</a>, which allows you to access the original message when you prepare a new <a shape="rect" href="exchange.html">Exchange</a> to be sent. You can use the <strong><code>copy</code></strong> option (enabled by default) to indicate whether you want this. If you set <strong><code>copy=false</code></strong>, then it works as in <strong>Camel 2.2</strong> or older where the <a shape="rect" href="exchange.html">Exchange</a> will be empty.</p><p>Below is the processor variation. This example is from <strong>Camel 2.3</strong>, where we disable <strong><code>copy</code></strong> by passing in <strong><code>false</code></strong> to create a new, empty <a shape="rect" href="exchange.html">Exchange</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("direct:start") .wireTap("direct:foo", false, new Processor() { @@ -15807,7 +15807,7 @@ from("direct:start") from("direct:foo").to("mock:foo"); ]]></script> -</div></div>Here is the <a shape="rect" href="expression.html">Expression</a> variation. This example is from Camel 2.3, where we disable <code>copy</code> by passing in <code>false</code> to create a new, empty <a shape="rect" href="exchange.html">Exchange</a>.<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>Here is the <a shape="rect" href="expression.html">Expression</a> variation. In the following example we disable copying by setting <strong><code>copy</code><code>=false</code></strong> which results in the creation of a new, empty <a shape="rect" href="exchange.html">Exchange</a>.<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") .wireTap("direct:foo", false, constant("Bye World")) @@ -15815,7 +15815,7 @@ from("direct:start") from("direct:foo").to("mock:foo"); ]]></script> -</div></div><strong>Using the <a shape="rect" href="spring-xml-extensions.html">Spring XML Extensions</a></strong><br clear="none"> The processor variation, which uses a <strong>processorRef</strong> attribute to refer to a Spring bean by ID:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><strong>Using the <a shape="rect" href="spring-xml-extensions.html">Spring XML Extensions</a></strong><br clear="none"> The processor variation, which uses a <strong><code>processorRef</code></strong> attribute to refer to a Spring bean by ID:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="direct:start2"/> @@ -15823,7 +15823,7 @@ from("direct:foo").to("mo <to uri="mock:result"/> </route> ]]></script> -</div></div>Here is the <a shape="rect" href="expression.html">Expression</a> variation, where the expression is defined in the <strong>body</strong> tag:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>Here is the <a shape="rect" href="expression.html">Expression</a> variation, where the expression is defined in the <strong><code>body</code></strong> tag:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="direct:start"/> @@ -15833,7 +15833,7 @@ from("direct:foo").to("mo <to uri="mock:result"/> </route> ]]></script> -</div></div>This variation accesses the body of the original message and creates a new <a shape="rect" href="exchange.html">Exchange</a> based on the <a shape="rect" href="expression.html">Expression</a>. It will create a new Exchange and have the body contain <code>"Bye ORIGINAL BODY MESSAGE HERE"</code><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>This variation accesses the body of the original message and creates a new <a shape="rect" href="exchange.html">Exchange</a> based on the <a shape="rect" href="expression.html">Expression</a>. It will create a new Exchange and have the body contain <code>"<strong>Bye ORIGINAL BODY MESSAGE HERE</strong>"</code><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="direct:start"/> @@ -15843,11 +15843,11 @@ from("direct:foo").to("mo <to uri="mock:result"/> </route> ]]></script> -</div></div><h4 id="BookInOnePage-FurtherExample">Further Example</h4><p>For another example of this pattern, refer to the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.java">wire tap test case</a>.</p><h3 id="BookInOnePage-UsingDynamicUris">Using Dynamic Uris</h3><p><strong>Available as of Camel 2.16:</strong></p><p>For example to wire tap to a dynamic uri, then it supports the same dynamic uris as documented in <a shape="rect" href="message-endpoint.html">Message Endpoint</a>. For example to wire tap to a JMS queue where the header ID is part of the queue name</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="BookInOnePage-FurtherExample">Further Example</h4><p>For another example of this pattern, refer to the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.java">wire tap test case</a>.</p><h3 id="BookInOnePage-UsingDynamicURIs">Using Dynamic URIs</h3><p><strong>Available as of Camel 2.16:</strong></p><p>For example to wire tap to a dynamic URI, then it supports the same dynamic URIs as documented in <a shape="rect" href="message-endpoint.html">Message Endpoint</a>. For example to wire tap to a JMS queue where the header ID is part of the queue name:</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") .wireTap("jms:queue:backup-${header.id}") .to("bean:doSomething");]]></script> -</div></div><p> </p><h3 id="BookInOnePage-SendinganewandsetheadersinDSL">Sending a new <a shape="rect" href="exchange.html">Exchange</a> and set headers in DSL</h3><p><strong>Available as of Camel 2.8</strong></p><p>If you send a new message using <a shape="rect" href="wire-tap.html">Wire Tap</a>, then you could only set the message body using an <a shape="rect" href="expression.html">Expression</a> from the DSL. If you also need to set headers, you would have to use a <a shape="rect" href="processor.html">Processor</a>. In Camel 2.8 onwards, you can now set headers as well in the DSL.</p><p>The following example sends a new message which has</p><ul class="alternate"><li>"Bye World" as message body</li><li>a header with key "id" with the value 123</li><li>a header with key "date" which has current date as value</li></ul><h4 id="BookInOnePage-JavaDSL.3">Java DSL</h4><p></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p> </p><h3 id="BookInOnePage-SendingaNewandSetHeadersinDSL">Sending a New <a shape="rect" href="exchange.html">Exchange</a> and Set Headers in DSL</h3><p><strong>Available as of Camel 2.8</strong></p><p>If you send a new message using <a shape="rect" href="wire-tap.html">Wire Tap</a>, then you could only set the message body using an <a shape="rect" href="expression.html">Expression</a> from the DSL. If you also need to set headers, you would have to use a <a shape="rect" href="processor.html">Processor</a>. From <strong>Camel 2.8</strong>: it's possible to set headers as well using the DSL.</p><p>The following example sends a new message which has</p><ul class="alternate"><li><strong><code>Bye World</code></strong> as message body.</li><li>A header with key <strong><code>id</code></strong> with the value <strong><code>123</code></strong>.</li><li>A header with key <strong><code>date</code></strong> which has current date as value.</li></ul><h4 id="BookIn OnePage-JavaDSL.3">Java DSL</h4><p></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") // tap a new message and send it to direct:tap @@ -15865,7 +15865,7 @@ from("direct:start") from("direct:tap") .to("mock:tap"); ]]></script> -</div></div><h4 id="BookInOnePage-XMLDSL">XML DSL</h4><p>The XML DSL is slightly different than Java DSL in how you configure the message body and headers using <body> and <setHeader>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="BookInOnePage-XMLDSL">XML DSL</h4><p>The XML DSL is slightly different than Java DSL in how you configure the message body and headers using <strong><code><body></code></strong> and <strong><code><setHeader></code></strong>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="direct:start"/> @@ -15881,7 +15881,7 @@ from("direct:tap") <to uri="mock:result"/> </route> ]]></script> -</div></div><h3 id="BookInOnePage-UsingonPreparetoexecutecustomlogicwhenpreparingmessages.3">Using onPrepare to execute custom logic when preparing messages</h3><p><strong>Available as of Camel 2.8</strong></p><p>See details at <a shape="rect" href="multicast.html">Multicast</a></p><p></p><h4 id="BookInOnePage-UsingThisPattern.47">Using This Pattern</h4> +</div></div><h3 id="BookInOnePage-UsingonPreparetoExecuteCustomLogicwhenPreparingMessages">Using <code>onPrepare</code> to Execute Custom Logic when Preparing Messages</h3><p><strong>Available as of Camel 2.8</strong></p><p>See details at <a shape="rect" href="multicast.html">Multicast</a></p><p></p><h4 id="BookInOnePage-UsingThisPattern.47">Using This Pattern</h4> <p>If you would like to use this EIP Pattern then please read the <a shape="rect" href="getting-started.html">Getting Started</a>, you may also find the <a shape="rect" href="architecture.html">Architecture</a> useful particularly the description of <a shape="rect" href="endpoint.html">Endpoint</a> and <a shape="rect" href="uris.html">URIs</a>. Then you could try out some of the <a shape="rect" href="examples.html">Examples</a> first before trying this pattern out.</p> <h2 id="BookInOnePage-Log">Log</h2><p>How can I log the processing of a <a shape="rect" href="message.html">Message</a>?</p><p>Camel provides many ways to log the fact that you are processing a message. Here are just a few examples:</p><ul class="alternate"><li>You can use the <a shape="rect" href="log.html">Log</a> component which logs the Message content.</li><li>You can use the <a shape="rect" href="tracer.html">Tracer</a> which trace logs message flow.</li><li>You can also use a <a shape="rect" href="processor.html">Processor</a> or <a shape="rect" href="bean.html">Bean</a> and log from Java code.</li><li>You can use the <code>log</code> DSL.</li></ul><h3 id="BookInOnePage-UsinglogDSL">Using log DSL</h3><p>In <strong>Camel 2.2</strong> you can use the <code>log</code> DSL which allows you to use <a shape="rect" href="simple.html">Simple</a> language to construct a dynamic message which gets logged.<br clear="none"> For example you can do</p><div class="code panel pdl" style="bor der-width: 1px;"><div class="codeContent panelContent pdl"> @@ -16866,11 +16866,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.rbtoc1489047639876 {padding: 0px;} -div.rbtoc1489047639876 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1489047639876 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1489169920293 {padding: 0px;} +div.rbtoc1489169920293 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1489169920293 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style></p><div class="toc-macro rbtoc1489047639876"> +/*]]>*/</style></p><div class="toc-macro rbtoc1489169920293"> <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 Fri Mar 10 18:20:17 2017 @@ -4539,7 +4539,7 @@ from("direct:start").choice() <h4 id="BookPatternAppendix-UsingThisPattern.46">Using This Pattern</h4> <p>If you would like to use this EIP Pattern then please read the <a shape="rect" href="getting-started.html">Getting Started</a>, you may also find the <a shape="rect" href="architecture.html">Architecture</a> useful particularly the description of <a shape="rect" href="endpoint.html">Endpoint</a> and <a shape="rect" href="uris.html">URIs</a>. Then you could try out some of the <a shape="rect" href="examples.html">Examples</a> first before trying this pattern out.</p> -<h3 id="BookPatternAppendix-WireTap">Wire Tap</h3><p><a shape="rect" class="external-link" href="http://www.enterpriseintegrationpatterns.com/WireTap.html" rel="nofollow">Wire Tap</a> (from the <a shape="rect" href="enterprise-integration-patterns.html">EIP patterns</a>) allows you to route messages to a separate location while they are being forwarded to the ultimate destination.</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://www.enterpriseintegrationpatterns.com/img/WireTap.gif" data-image-src="http://www.enterpriseintegrationpatterns.com/img/WireTap.gif"></span></p><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Streams</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>If you <a shape="rect" href="wire-tap.html">Wire Tap</a> a stream message body then you should consider enabling <a shape="rect" href="stream-caching.html">Stream caching</a> to ensure the message body can be read at each endpoint. See more details at <a shape="rect" href="stream-caching.html">Stream caching</a>.</p></div></div><h3 id="BookPatternAppendix-Options.11">Options</h3><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><strong>Mandatory:</strong> The URI of the endpoint to which the wire-tapped message will be sent. From <strong>Camel 2.16</strong> onwards support dynamic to uris like documented in <a shape="rect" class="exter nal-link" href="http://camel.apache.org/message-endpoint.html" style="line-height: 1.4285715;">Message Endpoint</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>executorServiceRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference identifier of a custom <a shape="rect" href="threading-model.html">Thread Pool</a> to use when processing the wire-tapped messages. If not set, Camel will use a default thread pool.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>processorRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference identifier of a custom <a shape="rect" href="processor.html">Processor</a> to use for creating a new message (e.g., the "send a new message" mode). See below.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>< code>copy</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.3</strong>: Whether to copy the <a shape="rect" href="exchange.html">Exchange</a> before wire-tapping the message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>onPrepareRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8:</strong> Reference identifier of a custom <a shape="rect" href="processor.html">Processor</a> to prepare the copy of the <a shape="rect" href="exchange.html">Exchange</a> to be wire-tapped. This allows you to do any custom logic, such as deep-cloning the message payload.</p></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="confluence Td"><span style="color: rgb(0,0,0);"><strong>Camel 2.16:</strong> Allows to configure the cache size for the </span><code>ProducerCache</code><span style="color: rgb(0,0,0);"> which caches producers for reuse. 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><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>ignoreInvalidEndpoint</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);">Whether to ignore an endpoint URI that could not be resolved. If disabled, Camel will throw an exception identifying the invalid endpoint URI.</span></td></tr></tbody></table></div><h3 id="BookPatternAppendix-WireTapthreadpool">WireTap thread pool</h3><p>The <a shape="rect" href="wire-tap.html">Wire Tap</a> uses a thread pool to process the tapped messages. T his thread pool will by default use the settings detailed at <a shape="rect" href="threading-model.html">Threading Model</a>. In particular, when the pool is exhausted (with all threads utilized), further wiretaps will be executed synchronously by the calling thread. To remedy this, you can configure an explicit thread pool on the <a shape="rect" href="wire-tap.html">Wire Tap</a> having either a different rejection policy, a larger worker queue, or more worker threads.</p><h3 id="BookPatternAppendix-WireTapnode">WireTap node</h3><p>Camel's Wire Tap node supports two flavors when tapping an <a shape="rect" href="exchange.html">Exchange</a>:</p><p>-With the traditional Wire Tap, Camel will copy the original <a shape="rect" href="exchange.html">Exchange</a> and set its <a shape="rect" href="exchange-pattern.html">Exchange Pattern</a> to InOnly, as we want the tapped <a shape="rect" href="exchange.html">Exchange</a> to be sent in a fire and forget style. The tapped <a shape="rect" href= "exchange.html">Exchange</a> is then sent in a separate thread so it can run in parallel with the original. Beware that only the Exchange is copied - Wire Tap won't do a deep clone (unless you specify a custom processor via <em>onPrepareRef</em> which does that). So all copies could share objects from the original Exchange.</p><p>-Camel also provides an option of sending a new <a shape="rect" href="exchange.html">Exchange</a> allowing you to populate it with new values.</p><h4 id="BookPatternAppendix-Sendingacopy(traditionalwiretap)">Sending a copy (traditional wiretap)</h4><p><strong>Using the <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"> +<h3 id="BookPatternAppendix-WireTap">Wire Tap</h3><p><a shape="rect" class="external-link" href="http://www.enterpriseintegrationpatterns.com/WireTap.html" rel="nofollow">Wire Tap</a> (from the <a shape="rect" href="enterprise-integration-patterns.html">EIP patterns</a>) allows you to route messages to a separate location while they are being forwarded to the ultimate destination.</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://www.enterpriseintegrationpatterns.com/img/WireTap.gif" data-image-src="http://www.enterpriseintegrationpatterns.com/img/WireTap.gif"></span></p><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Streams</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>If you <a shape="rect" href="wire-tap.html">Wire Tap</a> a stream message body then you should consider enabling <a shape="rect" href="stream-caching.html">Stream caching</a> to ensure the message body can be read at each endpoint. See more details at <a shape="rect" href="stream-caching.html">Stream caching</a>.</p></div></div><h3 id="BookPatternAppendix-Options.11">Options</h3><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">Name</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>uri</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong><span style="color: rgb(255,0,0);">Mandatory</span>:</strong> The URI of the endpoint to which the wire-tapped message should be sent.</p><p>From <strong>Camel 2.16</strong>: support for dynamic <strong><code>to </code></strong> URIs is as documented in <a shape="rect" class="external-link" href="http://camel.apache.org/message-endpoint.html" style="line-height: 1.4285715;">Message Endpoint.</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>executorServiceRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference ID of a custom <a shape="rect" href="threading-model.html">Thread Pool</a> to use when processing the wire-tapped messages.</p><p>When not set, Camel will use an instance of the default thread pool.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>processorRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference ID of a custom <a shape="rect" href="processor.html">Processor</a> to use for creating a new message.</p><p>See "<strong>Sending a New Exchan ge</strong>" below.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>copy</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.3</strong>: Whether to copy the <a shape="rect" href="exchange.html">Exchange</a> before wire-tapping the message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>onPrepareRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8:</strong> Reference identifier of a custom <a shape="rect" href="processor.html">Processor</a> to prepare the copy of the <a shape="rect" href="exchange.html">Exchange</a> to be wire-tapped. This allows you to do any custom logic, such as deep-cloning the message payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>cacheSize</code></p></td><td cols pan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(0,0,0);"><strong>Camel 2.16:</strong> Allows to configure the cache size for the </span><strong><code>ProducerCache</code></strong><span style="color: rgb(0,0,0);"> which caches producers for reuse. Will by default use the default cache size which is <strong><code>1000</code></strong>. </span></p><p><span style="color: rgb(0,0,0);">Setting the value to <strong><code>-1</code></strong> allows to turn off the cache all together.</span></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ignoreInvalidEndpoint</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.16:</strong> <span style="color: rgb(0,0,0);">Whether to ignore an endpoint URI that could not be resolved. </span></p><p><span style="color: rgb(0,0,0);">Wh en <strong><code>false</code></strong>, Camel will throw an exception when it identifies an invalid endpoint URI.</span></p></td></tr></tbody></table></div><h3 id="BookPatternAppendix-WireTapThreadpool">WireTap Threadpool</h3><p>The <a shape="rect" href="wire-tap.html">Wire Tap</a> uses a thread pool to process the tapped messages. This thread pool will by default use the settings detailed at <a shape="rect" href="threading-model.html">Threading Model</a>. In particular, when the pool is exhausted (with all threads utilized), further wiretaps will be executed synchronously by the calling thread. To remedy this, you can configure an explicit thread pool on the <a shape="rect" href="wire-tap.html">Wire Tap</a> having either a different rejection policy, a larger worker queue, or more worker threads.</p><h3 id="BookPatternAppendix-WireTapNode">WireTap Node</h3><p>Camel's Wire Tap node supports two flavors when tapping an <a shape="rect" href="exchange.html">Exchange</a>:</p><ul><li>Wit h the traditional Wire Tap, Camel will copy the original <a shape="rect" href="exchange.html">Exchange</a> and set its <a shape="rect" href="exchange-pattern.html">Exchange Pattern</a> to <strong><code>InOnly</code></strong>, as we want the tapped <a shape="rect" href="exchange.html">Exchange</a> to be sent in a fire and forget style. The tapped <a shape="rect" href="exchange.html">Exchange</a> is then sent in a separate thread so it can run in parallel with the original. Beware that only the Exchange is copied - Wire Tap won't do a deep clone (unless you specify a custom processor via <strong><code>onPrepareRef</code></strong> which does that). So all copies could share objects from the original Exchange.</li><li>Camel also provides an option of sending a new <a shape="rect" href="exchange.html">Exchange</a> allowing you to populate it with new values.</li></ul><h4 id="BookPatternAppendix-SendingaCopy(traditionalwiretap)">Sending a Copy (traditional wiretap)</h4><p><strong>Usi ng the <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[ from("direct:start") .to("log:foo") @@ -4555,7 +4555,7 @@ from("direct:start") <to uri="mock:result"/> </route> ]]></script> -</div></div><h4 id="BookPatternAppendix-Sendinganew">Sending a new <a shape="rect" href="exchange.html">Exchange</a></h4><p><strong>Using the <a shape="rect" href="fluent-builders.html">Fluent Builders</a></strong><br clear="none"> Camel supports either a processor or an <a shape="rect" href="expression.html">Expression</a> to populate the new <a shape="rect" href="exchange.html">Exchange</a>. Using a processor gives you full power over how the <a shape="rect" href="exchange.html">Exchange</a> is populated as you can set properties, headers, et cetera. An <a shape="rect" href="expression.html">Expression</a> can only be used to set the IN body.</p><p>From <strong>Camel 2.3</strong> onwards the <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="processor.html">Processor</a> is pre-populated with a copy of the original <a shape="rect" href="exchange.html">Exchange</a>, which allows you to access the original message when you prepare a new <a shape="rect" hr ef="exchange.html">Exchange</a> to be sent. You can use the <code>copy</code> option (enabled by default) to indicate whether you want this. If you set <code>copy=false</code>, then it works as in Camel 2.2 or older where the <a shape="rect" href="exchange.html">Exchange</a> will be empty.</p><p>Below is the processor variation. This example is from Camel 2.3, where we disable <code>copy</code> by passing in <code>false</code> to create a new, empty <a shape="rect" href="exchange.html">Exchange</a>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="BookPatternAppendix-SendingaNew">Sending a New <a shape="rect" href="exchange.html">Exchange</a></h4><p><strong>Using the <a shape="rect" href="fluent-builders.html">Fluent Builders</a></strong><br clear="none"> Camel supports either a processor or an <a shape="rect" href="expression.html">Expression</a> to populate the new <a shape="rect" href="exchange.html">Exchange</a>. Using a processor gives you full power over how the <a shape="rect" href="exchange.html">Exchange</a> is populated as you can set properties, headers, etc. An <a shape="rect" href="expression.html">Expression</a> can only be used to set the <strong><code>IN</code></strong> body.</p><p>From <strong>Camel 2.3</strong>: the <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="processor.html">Processor</a> is pre-populated with a copy of the original <a shape="rect" href="exchange.html">Exchange</a>, which allows you to access the original message when you prepare a new <a shape="rect" href="exchange.html">Exchange</a> to be sent. You can use the <strong><code>copy</code></strong> option (enabled by default) to indicate whether you want this. If you set <strong><code>copy=false</code></strong>, then it works as in <strong>Camel 2.2</strong> or older where the <a shape="rect" href="exchange.html">Exchange</a> will be empty.</p><p>Below is the processor variation. This example is from <strong>Camel 2.3</strong>, where we disable <strong><code>copy</code></strong> by passing in <strong><code>false</code></strong> to create a new, empty <a shape="rect" href="exchange.html">Exchange</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("direct:start") .wireTap("direct:foo", false, new Processor() { @@ -4568,7 +4568,7 @@ from("direct:start") from("direct:foo").to("mock:foo"); ]]></script> -</div></div>Here is the <a shape="rect" href="expression.html">Expression</a> variation. This example is from Camel 2.3, where we disable <code>copy</code> by passing in <code>false</code> to create a new, empty <a shape="rect" href="exchange.html">Exchange</a>.<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>Here is the <a shape="rect" href="expression.html">Expression</a> variation. In the following example we disable copying by setting <strong><code>copy</code><code>=false</code></strong> which results in the creation of a new, empty <a shape="rect" href="exchange.html">Exchange</a>.<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") .wireTap("direct:foo", false, constant("Bye World")) @@ -4576,7 +4576,7 @@ from("direct:start") from("direct:foo").to("mock:foo"); ]]></script> -</div></div><strong>Using the <a shape="rect" href="spring-xml-extensions.html">Spring XML Extensions</a></strong><br clear="none"> The processor variation, which uses a <strong>processorRef</strong> attribute to refer to a Spring bean by ID:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><strong>Using the <a shape="rect" href="spring-xml-extensions.html">Spring XML Extensions</a></strong><br clear="none"> The processor variation, which uses a <strong><code>processorRef</code></strong> attribute to refer to a Spring bean by ID:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="direct:start2"/> @@ -4584,7 +4584,7 @@ from("direct:foo").to("mo <to uri="mock:result"/> </route> ]]></script> -</div></div>Here is the <a shape="rect" href="expression.html">Expression</a> variation, where the expression is defined in the <strong>body</strong> tag:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>Here is the <a shape="rect" href="expression.html">Expression</a> variation, where the expression is defined in the <strong><code>body</code></strong> tag:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="direct:start"/> @@ -4594,7 +4594,7 @@ from("direct:foo").to("mo <to uri="mock:result"/> </route> ]]></script> -</div></div>This variation accesses the body of the original message and creates a new <a shape="rect" href="exchange.html">Exchange</a> based on the <a shape="rect" href="expression.html">Expression</a>. It will create a new Exchange and have the body contain <code>"Bye ORIGINAL BODY MESSAGE HERE"</code><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>This variation accesses the body of the original message and creates a new <a shape="rect" href="exchange.html">Exchange</a> based on the <a shape="rect" href="expression.html">Expression</a>. It will create a new Exchange and have the body contain <code>"<strong>Bye ORIGINAL BODY MESSAGE HERE</strong>"</code><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="direct:start"/> @@ -4604,11 +4604,11 @@ from("direct:foo").to("mo <to uri="mock:result"/> </route> ]]></script> -</div></div><h4 id="BookPatternAppendix-FurtherExample">Further Example</h4><p>For another example of this pattern, refer to the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.java">wire tap test case</a>.</p><h3 id="BookPatternAppendix-UsingDynamicUris">Using Dynamic Uris</h3><p><strong>Available as of Camel 2.16:</strong></p><p>For example to wire tap to a dynamic uri, then it supports the same dynamic uris as documented in <a shape="rect" href="message-endpoint.html">Message Endpoint</a>. For example to wire tap to a JMS queue where the header ID is part of the queue name</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="BookPatternAppendix-FurtherExample">Further Example</h4><p>For another example of this pattern, refer to the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.java">wire tap test case</a>.</p><h3 id="BookPatternAppendix-UsingDynamicURIs">Using Dynamic URIs</h3><p><strong>Available as of Camel 2.16:</strong></p><p>For example to wire tap to a dynamic URI, then it supports the same dynamic URIs as documented in <a shape="rect" href="message-endpoint.html">Message Endpoint</a>. For example to wire tap to a JMS queue where the header ID is part of the queue name:</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") .wireTap("jms:queue:backup-${header.id}") .to("bean:doSomething");]]></script> -</div></div><p> </p><h3 id="BookPatternAppendix-SendinganewandsetheadersinDSL">Sending a new <a shape="rect" href="exchange.html">Exchange</a> and set headers in DSL</h3><p><strong>Available as of Camel 2.8</strong></p><p>If you send a new message using <a shape="rect" href="wire-tap.html">Wire Tap</a>, then you could only set the message body using an <a shape="rect" href="expression.html">Expression</a> from the DSL. If you also need to set headers, you would have to use a <a shape="rect" href="processor.html">Processor</a>. In Camel 2.8 onwards, you can now set headers as well in the DSL.</p><p>The following example sends a new message which has</p><ul class="alternate"><li>"Bye World" as message body</li><li>a header with key "id" with the value 123</li><li>a header with key "date" which has current date as value</li></ul><h4 id="BookPatternAppendix-JavaDSL.1">Java DSL</h4><p></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl "> +</div></div><p> </p><h3 id="BookPatternAppendix-SendingaNewandSetHeadersinDSL">Sending a New <a shape="rect" href="exchange.html">Exchange</a> and Set Headers in DSL</h3><p><strong>Available as of Camel 2.8</strong></p><p>If you send a new message using <a shape="rect" href="wire-tap.html">Wire Tap</a>, then you could only set the message body using an <a shape="rect" href="expression.html">Expression</a> from the DSL. If you also need to set headers, you would have to use a <a shape="rect" href="processor.html">Processor</a>. From <strong>Camel 2.8</strong>: it's possible to set headers as well using the DSL.</p><p>The following example sends a new message which has</p><ul class="alternate"><li><strong><code>Bye World</code></strong> as message body.</li><li>A header with key <strong><code>id</code></strong> with the value <strong><code>123</code></strong>.</li><li>A header with key <strong><code>date</code></strong> which has current date as value.</li></ul><h4 id=" BookPatternAppendix-JavaDSL.1">Java DSL</h4><p></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") // tap a new message and send it to direct:tap @@ -4626,7 +4626,7 @@ from("direct:start") from("direct:tap") .to("mock:tap"); ]]></script> -</div></div><h4 id="BookPatternAppendix-XMLDSL">XML DSL</h4><p>The XML DSL is slightly different than Java DSL in how you configure the message body and headers using <body> and <setHeader>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="BookPatternAppendix-XMLDSL">XML DSL</h4><p>The XML DSL is slightly different than Java DSL in how you configure the message body and headers using <strong><code><body></code></strong> and <strong><code><setHeader></code></strong>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="direct:start"/> @@ -4642,7 +4642,7 @@ from("direct:tap") <to uri="mock:result"/> </route> ]]></script> -</div></div><h3 id="BookPatternAppendix-UsingonPreparetoexecutecustomlogicwhenpreparingmessages.3">Using onPrepare to execute custom logic when preparing messages</h3><p><strong>Available as of Camel 2.8</strong></p><p>See details at <a shape="rect" href="multicast.html">Multicast</a></p><p></p><h4 id="BookPatternAppendix-UsingThisPattern.47">Using This Pattern</h4> +</div></div><h3 id="BookPatternAppendix-UsingonPreparetoExecuteCustomLogicwhenPreparingMessages">Using <code>onPrepare</code> to Execute Custom Logic when Preparing Messages</h3><p><strong>Available as of Camel 2.8</strong></p><p>See details at <a shape="rect" href="multicast.html">Multicast</a></p><p></p><h4 id="BookPatternAppendix-UsingThisPattern.47">Using This Pattern</h4> <p>If you would like to use this EIP Pattern then please read the <a shape="rect" href="getting-started.html">Getting Started</a>, you may also find the <a shape="rect" href="architecture.html">Architecture</a> useful particularly the description of <a shape="rect" href="endpoint.html">Endpoint</a> and <a shape="rect" href="uris.html">URIs</a>. Then you could try out some of the <a shape="rect" href="examples.html">Examples</a> first before trying this pattern out.</p> <h2 id="BookPatternAppendix-Log">Log</h2><p>How can I log the processing of a <a shape="rect" href="message.html">Message</a>?</p><p>Camel provides many ways to log the fact that you are processing a message. Here are just a few examples:</p><ul class="alternate"><li>You can use the <a shape="rect" href="log.html">Log</a> component which logs the Message content.</li><li>You can use the <a shape="rect" href="tracer.html">Tracer</a> which trace logs message flow.</li><li>You can also use a <a shape="rect" href="processor.html">Processor</a> or <a shape="rect" href="bean.html">Bean</a> and log from Java code.</li><li>You can use the <code>log</code> DSL.</li></ul><h3 id="BookPatternAppendix-UsinglogDSL">Using log DSL</h3><p>In <strong>Camel 2.2</strong> you can use the <code>log</code> DSL which allows you to use <a shape="rect" href="simple.html">Simple</a> language to construct a dynamic message which gets logged.<br clear="none"> For example you can do</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.