Modified: websites/production/camel/content/routing-slip.html
==============================================================================
--- websites/production/camel/content/routing-slip.html (original)
+++ websites/production/camel/content/routing-slip.html Fri Aug 25 08:22:01 2017
@@ -36,17 +36,6 @@
<![endif]-->
- <link href='//camel.apache.org/styles/highlighter/styles/shCoreCamel.css'
rel='stylesheet' type='text/css' />
- <link href='//camel.apache.org/styles/highlighter/styles/shThemeCamel.css'
rel='stylesheet' type='text/css' />
- <script src='//camel.apache.org/styles/highlighter/scripts/shCore.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushJava.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushXml.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushPlain.js'
type='text/javascript'></script>
-
- <script type="text/javascript">
- SyntaxHighlighter.defaults['toolbar'] = false;
- SyntaxHighlighter.all();
- </script>
<title>
Apache Camel: Routing Slip
@@ -86,57 +75,36 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h3 id="RoutingSlip-RoutingSlip">Routing
Slip</h3><p>The <a shape="rect" class="external-link"
href="http://www.enterpriseintegrationpatterns.com/RoutingTable.html"
rel="nofollow">Routing Slip</a> from the <a shape="rect"
href="enterprise-integration-patterns.html">EIP patterns</a> allows you to
route a message consecutively through a series of processing steps where the
sequence of steps is not known at design time and can vary for each
message.</p><p><span class="confluence-embedded-file-wrapper"><img
class="confluence-embedded-image confluence-external-resource"
src="http://www.enterpriseintegrationpatterns.com/img/RoutingTableSimple.gif"
data-image-src="http://www.enterpriseintegrationpatterns.com/img/RoutingTableSimple.gif"></span></p><h3
id="RoutingSlip-Options">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>uriDelimiter</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>,</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Delimiter used if the <a
shape="rect" href="expression.html">Expression</a> returned multiple
endpoints.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>ignoreInvalidEndpoints</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>If an endpoint URI could not be
resolved, should it be ignored.</p><p>Otherwise, Camel will throw an exception
stating the endpoint URI is not valid.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>cacheSize</code></p></td><td
colspan="1" rowspan="1" class
="confluenceTd"><p><code>1000</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Camel 2.13.1/2.12.4:</strong> Allows to
configure the cache size for the <strong><code>ProducerCache</code></strong>
which caches producers for reuse in the routing slip.</p><p>The default cache
size is <strong><code>1000</code></strong>.</p><p>A value of
<strong><code>-1</code></strong> disables the use of the
cache.</p></td></tr></tbody></table></div></div>
-
-
-<h4 id="RoutingSlip-Example">Example</h4><p>The following route will take any
messages sent to the <a shape="rect" class="external-link"
href="http://activemq.apache.org">Apache ActiveMQ</a> queue
<strong><code>SomeQueue</code></strong> and pass them into the <a shape="rect"
class="external-link"
href="http://www.enterpriseintegrationpatterns.com/RoutingTable.html"
rel="nofollow">Routing Slip</a> pattern.</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("activemq:SomeQueue")
- .routingSlip("aRoutingSlipHeader");
-]]></script>
-</div></div><p>Messages will be checked for the existence of
the <strong><code>aRoutingSlipHeader</code></strong> header. The value of
this header should be a comma-delimited list of endpoint <a shape="rect"
href="uris.html">URIs</a> you wish the message to be routed to. The <a
shape="rect" href="message.html">Message</a> will be routed in a <a
shape="rect" href="pipes-and-filters.html">pipeline</a> fashion, i.e., one
after the other. From <strong>Camel 2.5</strong> the <a shape="rect"
href="routing-slip.html">Routing Slip</a> will set a property,
<strong><code>Exchange.SLIP_ENDPOINT</code></strong>, on the <a shape="rect"
href="exchange.html">Exchange</a> which contains the current endpoint as it
advanced though the slip. This allows you to <em>know</em> how far we have
processed in the slip.</p><p>The <a shape="rect"
href="routing-slip.html">Routing Slip</a> will compute the slip
<strong>beforehand</strong> which means, the slip is only computed once. If you
need to compute t
he slip <em>on-the-fly</em> then use the <a shape="rect"
href="dynamic-router.html">Dynamic Router</a> pattern instead.</p><h4
id="RoutingSlip-ConfigurationOptions">Configuration Options</h4><p>Here we set
the header name and the URI delimiter to something
different.</p><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">
-<script class="brush: java; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[
-from("direct:c").routingSlip(header("aRoutingSlipHeader"),
"#");
-]]></script>
-</div></div><strong>Using the <a shape="rect"
href="spring-xml-extensions.html">Spring XML Extensions</a></strong><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[<camelContext
id="buildRoutingSlip"
xmlns="http://activemq.apache.org/camel/schema/spring">
+<div class="wiki-content maincontent"><h3 id="RoutingSlip-RoutingSlip">Routing
Slip</h3><p>The <a shape="rect" class="external-link"
href="http://www.enterpriseintegrationpatterns.com/RoutingTable.html"
rel="nofollow">Routing Slip</a> from the <a shape="rect"
href="enterprise-integration-patterns.html">EIP patterns</a> allows you to
route a message consecutively through a series of processing steps where the
sequence of steps is not known at design time and can vary for each
message.</p><p><span class="confluence-embedded-file-wrapper"><img
class="confluence-embedded-image confluence-external-resource"
src="http://www.enterpriseintegrationpatterns.com/img/RoutingTableSimple.gif"
data-image-src="http://www.enterpriseintegrationpatterns.com/img/RoutingTableSimple.gif"></span></p><h3
id="RoutingSlip-Options">Options</h3><parameter
ac:name="class">confluenceTableSmall</parameter><rich-text-body><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>uriDelimiter</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>,</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Delimiter used if the <a
shape="rect" href="expression.html">Expression</a> returned multiple
endpoints.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>ignoreInvalidEndpoints</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>If an endpoint URI could not be
resolved, should it be ignored.</p><p>Otherwise, Camel will throw an exception
stating the endpoint URI is not valid.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>cacheSize</code><
/p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>1000</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong>Camel 2.13.1/2.12.4:</strong> Allows to
configure the cache size for the <strong><code>ProducerCache</code></strong>
which caches producers for reuse in the routing slip.</p><p>The default cache
size is <strong><code>1000</code></strong>.</p><p>A value of
<strong><code>-1</code></strong> disables the use of the
cache.</p></td></tr></tbody></table></div></rich-text-body><h4
id="RoutingSlip-Example">Example</h4><p>The following route will take any
messages sent to the <a shape="rect" class="external-link"
href="http://activemq.apache.org">Apache ActiveMQ</a> queue
<strong><code>SomeQueue</code></strong> and pass them into the <a shape="rect"
class="external-link"
href="http://www.enterpriseintegrationpatterns.com/RoutingTable.html"
rel="nofollow">Routing Slip</a> pattern.</p><parameter
ac:name="language">java</parameter><plain-text-body>from
("activemq:SomeQueue")
+ .routingSlip("aRoutingSlipHeader");
+</plain-text-body><p>Messages will be checked for the existence of
the <strong><code>aRoutingSlipHeader</code></strong> header. The value of
this header should be a comma-delimited list of endpoint <a shape="rect"
href="uris.html">URIs</a> you wish the message to be routed to. The <a
shape="rect" href="message.html">Message</a> will be routed in a <a
shape="rect" href="pipes-and-filters.html">pipeline</a> fashion, i.e., one
after the other. From <strong>Camel 2.5</strong> the <a shape="rect"
href="routing-slip.html">Routing Slip</a> will set a property,
<strong><code>Exchange.SLIP_ENDPOINT</code></strong>, on the <a shape="rect"
href="exchange.html">Exchange</a> which contains the current endpoint as it
advanced though the slip. This allows you to <em>know</em> how far we have
processed in the slip.</p><p>The <a shape="rect"
href="routing-slip.html">Routing Slip</a> will compute the slip
<strong>beforehand</strong> which means, the slip is only computed once. If you
need to com
pute the slip <em>on-the-fly</em> then use the <a shape="rect"
href="dynamic-router.html">Dynamic Router</a> pattern instead.</p><h4
id="RoutingSlip-ConfigurationOptions">Configuration Options</h4><p>Here we set
the header name and the URI delimiter to something
different.</p><p><strong>Using the <a shape="rect"
href="fluent-builders.html">Fluent
Builders</a></strong><plain-text-body>{snippet:id=e3|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipTest.java}</plain-text-body><strong>Using
the <a shape="rect" href="spring-xml-extensions.html">Spring XML
Extensions</a></strong></p><plain-text-body><camelContext
id="buildRoutingSlip" xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
- <from uri="direct:c"/>
- <routingSlip uriDelimiter="#">
+ <from uri="direct:c"/>
+ <routingSlip uriDelimiter="#">
<header>aRoutingSlipHeader</header>
</routingSlip>
</route>
</camelContext>
-]]></script>
-</div></div><h3 id="RoutingSlip-IgnoreInvalidEndpoints">Ignore Invalid
Endpoints</h3><p><strong>Available as of Camel 2.3</strong></p><p>The <a
shape="rect" href="routing-slip.html">Routing Slip</a> now supports
<strong><code>ignoreInvalidEndpoints</code></strong> which the <a shape="rect"
href="recipient-list.html">Recipient List</a> also supports. You can use it to
skip endpoints which are invalid.</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:a")
- .routingSlip("myHeader")
+</plain-text-body><h3 id="RoutingSlip-IgnoreInvalidEndpoints">Ignore Invalid
Endpoints</h3><p><strong>Available as of Camel 2.3</strong></p><p>The <a
shape="rect" href="routing-slip.html">Routing Slip</a> now supports
<strong><code>ignoreInvalidEndpoints</code></strong> which the <a shape="rect"
href="recipient-list.html">Recipient List</a> also supports. You can use it to
skip endpoints which are invalid.</p><parameter
ac:name="language">java</parameter><plain-text-body>from("direct:a")
+ .routingSlip("myHeader")
.ignoreInvalidEndpoints();
-]]></script>
-</div></div><p>And in Spring XML its an attribute on the recipient list
tag:</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:a"/>
- <routingSlip ignoreInvalidEndpoints="true"/>
+</plain-text-body><p>And in Spring XML its an attribute on the recipient list
tag:</p><parameter
ac:name="language">xml</parameter><plain-text-body><route>
+ <from uri="direct:a"/>
+ <routingSlip ignoreInvalidEndpoints="true"/>
<header>myHeader</header>
</routingSlip>
</route>
-]]></script>
-</div></div><p>Then let's say the <strong><code>myHeader</code></strong>
contains the following two endpoints
<strong><code>direct:foo,xxx:bar</code></strong>. The first endpoint is valid
and works. However the second endpoint is invalid and will just be ignored.
Camel logs at <strong><code>INFO</code></strong> level, so you can see why
the endpoint was invalid.</p><h3 id="RoutingSlip-ExpressionSupport">Expression
Support</h3><p><strong>Available as of Camel 2.4</strong></p><p>The <a
shape="rect" href="routing-slip.html">Routing Slip</a> now supports to take the
expression parameter as the <a shape="rect"
href="recipient-list.html">Recipient List</a> does. You can tell Camel the
expression that you want to use to get the routing slip.</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:a")
- .routingSlip(header("myHeader"))
+</plain-text-body><p>Then let's say the <strong><code>myHeader</code></strong>
contains the following two endpoints
<strong><code>direct:foo,xxx:bar</code></strong>. The first endpoint is valid
and works. However the second endpoint is invalid and will just be ignored.
Camel logs at <strong><code>INFO</code></strong> level, so you can see why
the endpoint was invalid.</p><h3 id="RoutingSlip-ExpressionSupport">Expression
Support</h3><p><strong>Available as of Camel 2.4</strong></p><p>The <a
shape="rect" href="routing-slip.html">Routing Slip</a> now supports to take the
expression parameter as the <a shape="rect"
href="recipient-list.html">Recipient List</a> does. You can tell Camel the
expression that you want to use to get the routing slip.</p><parameter
ac:name="language">java</parameter><plain-text-body>from("direct:a")
+ .routingSlip(header("myHeader"))
.ignoreInvalidEndpoints();
-]]></script>
-</div></div><p>And in Spring XML its an attribute on the recipient list
tag.</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:a"/>
+</plain-text-body><p>And in Spring XML its an attribute on the recipient list
tag.</p><parameter
ac:name="language">xml</parameter><plain-text-body><route>
+ <from uri="direct:a"/>
<!--NOTE from Camel 2.4.0, you need to specify the expression element
inside of the routingSlip element -->
- <routingSlip ignoreInvalidEndpoints="true">
+ <routingSlip ignoreInvalidEndpoints="true">
<header>myHeader</header>
</routingSlip>
</route>
-]]></script>
-</div></div><h4 id="RoutingSlip-FurtherExamples">Further Examples</h4><p>For
further examples of this pattern in use you could look at the <a shape="rect"
class="external-link"
href="http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip">routing
slip test cases</a>.</p><p></p><h4 id="RoutingSlip-UsingThisPattern">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></div>
+</plain-text-body><h4 id="RoutingSlip-FurtherExamples">Further
Examples</h4><p>For further examples of this pattern in use you could look at
the <a shape="rect" class="external-link"
href="http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip">routing
slip test cases</a>.</p><p><parameter ac:name=""><a shape="rect"
href="using-this-pattern.html">Using This Pattern</a></parameter></p></div>
</td>
<td valign="top">
<div class="navigation">
Modified: websites/production/camel/content/ruby.html
==============================================================================
--- websites/production/camel/content/ruby.html (original)
+++ websites/production/camel/content/ruby.html Fri Aug 25 08:22:01 2017
@@ -41,7 +41,6 @@
<script src='//camel.apache.org/styles/highlighter/scripts/shCore.js'
type='text/javascript'></script>
<script src='//camel.apache.org/styles/highlighter/scripts/shBrushJava.js'
type='text/javascript'></script>
<script src='//camel.apache.org/styles/highlighter/scripts/shBrushXml.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushPlain.js'
type='text/javascript'></script>
<script type="text/javascript">
SyntaxHighlighter.defaults['toolbar'] = false;
@@ -130,46 +129,19 @@
]]></script>
</div></div>
-<h3 id="Ruby-ScriptContextOptions"><code>ScriptContext</code>
Options</h3><p> </p><div class="confluence-information-macro
confluence-information-macro-information"><span class="aui-icon aui-icon-small
aui-iconfont-info confluence-information-macro-icon"></span><div
class="confluence-information-macro-body">The <code>JSR-223</code>
scripting language's <strong><code>ScriptContext</code></strong> is
pre-configured with the following attributes all set at
<strong><code>ENGINE_SCOPE</code></strong>.</div></div><div
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1"
rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1"
rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><span><code>camelContext</code><br
clear="none"></span></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>org.apache.camel.Ca
melContext</code></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>The Camel Context.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>context</code></p></td><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context (cannot be
used in groovy).</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>exchange</code></p></td><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>The current
Exchange.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>properties</code></p></td><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong>
Function with a <strong>
<code>resolve</code></strong> method to make it easier to use Camels <a
shape="rect" href="properties.html">Properties</a> component from scripts. See
further below for example.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>request</code></p></td><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td
colspan="1" rowspan="1"
class="confluenceTd"><p>The <strong><code>IN</code></strong>
message.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>response</code></p></td><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>:
The <strong><code>OUT</code></strong> message.
The <strong><code>OUT</code></strong> message
is <strong><code>null</code></strong> by default. Use the
<strong><code>IN</code></strong> message instead.</p></td></tr></tbody></tab
le></div><p>See <a shape="rect" href="scripting-languages.html">Scripting
Languages</a> for the list of languages with explicit DSL support.</p><h3
id="Ruby-PassingAdditionalArgumentstotheScriptingEngine">Passing Additional
Arguments to the <code>ScriptingEngine</code></h3><p><strong>Available
from Camel 2.8</strong></p><p>You can provide additional arguments to the
<strong><code>ScriptingEngine</code></strong> using a header on the Camel
message with the key
<strong><code>CamelScriptArguments</code></strong>.</p><p>Example:</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[
-public void testArgumentsExample() throws Exception {
- getMockEndpoint("mock:result").expectedMessageCount(0);
- getMockEndpoint("mock:unmatched").expectedMessageCount(1);
-
- // additional arguments to ScriptEngine
- Map<String, Object> arguments = new HashMap<String, Object>();
- arguments.put("foo", "bar");
- arguments.put("baz", 7);
-
- // those additional arguments is provided as a header on the Camel Message
- template.sendBodyAndHeader("direct:start", "hello",
ScriptBuilder.ARGUMENTS, arguments);
-
- assertMockEndpointsSatisfied();
-}
-]]></script>
-</div></div><h3 id="Ruby-UsingPropertiesFunction">Using Properties
Function</h3><p><strong>Available from Camel 2.9</strong></p><p>If you need to
use the <a shape="rect" href="properties.html">Properties</a> component from a
script to lookup property placeholders, then its a bit cumbersome to do so. For
example, to set a header name <strong><code>myHeader</code></strong> with
a value from a property placeholder, whose key is taken from a header named
<strong><code>foo</code></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[.setHeader("myHeader").groovy("context.resolvePropertyPlaceholders('{{'
+ request.headers.get('foo') + '}}')")
-]]></script>
-</div></div><p>From <strong>Camel 2.9</strong>: you can now use the properties
function and the same example is simpler:</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[.setHeader("myHeader").groovy("properties.resolve(request.headers.get('foo'))")
-]]></script>
-</div></div><h3 id="Ruby-LoadingScriptFromExternalResource">Loading Script
From External Resource</h3><p><strong>Available from Camel
2.11</strong></p><p>You can externalize the script and have Camel load it from
a resource such as <strong><code>classpath:</code></strong>,
<strong><code>file:</code></strong>, or <strong><code>http:</code></strong>.
This is done using the following syntax:
<strong><code>resource:scheme:location</code></strong> e.g. to refer to a file
on the classpath you can do:</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[.setHeader("myHeader").groovy("resource:classpath:mygroovy.groovy")
-]]></script>
-</div></div><h3 id="Ruby-HowtoGettheResultfromMultipleStatementsScript">How to
Get the Result from Multiple Statements Script</h3><p><strong>Available from
Camel 2.14</strong></p><p>The script engine's eval method returns
a <strong><code>null</code></strong> when it runs a multi-statement
script. However, Camel can look up the value of a script's result by using the
key <strong><code>result</code></strong> from the value set. When writing a
multi-statement script set the value of
the <strong><code>result</code></strong> variable as the script return
value.</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<script class="brush: text; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[bar = "baz";
+<h3 id="Ruby-ScriptContextOptions"><code>ScriptContext</code>
Options</h3><p> </p><rich-text-body>The <code>JSR-223</code>
scripting language's <strong><code>ScriptContext</code></strong> is
pre-configured with the following attributes all set at
<strong><code>ENGINE_SCOPE</code></strong>.</rich-text-body><div
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1"
rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1"
rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><span><code>camelContext</code><br
clear="none"></span></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>The Camel
Context.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>context</code></p></td><td colspan
="1" rowspan="1"
class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context (cannot be
used in groovy).</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>exchange</code></p></td><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>The current
Exchange.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>properties</code></p></td><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong>
Function with a <strong><code>resolve</code></strong> method to make it easier
to use Camels <a shape="rect" href="properties.html">Properties</a> component
from scripts. See further below for example.</p></td></tr><tr><td colspan
="1" rowspan="1" class="confluenceTd"><p><code>request</code></p></td><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td
colspan="1" rowspan="1"
class="confluenceTd"><p>The <strong><code>IN</code></strong>
message.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>response</code></p></td><td colspan="1"
rowspan="1"
class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>:
The <strong><code>OUT</code></strong> message.
The <strong><code>OUT</code></strong> message
is <strong><code>null</code></strong> by default. Use the
<strong><code>IN</code></strong> message
instead.</p></td></tr></tbody></table></div><p>See <a shape="rect"
href="scripting-languages.html">Scripting Languages</a> for the list of
languages with explicit DSL support.</p><h3
id="Ruby-PassingAdditionalArgumentstotheScriptingEngine">P
assing Additional Arguments to
the <code>ScriptingEngine</code></h3><p><strong>Available from Camel
2.8</strong></p><p>You can provide additional arguments to the
<strong><code>ScriptingEngine</code></strong> using a header on the Camel
message with the key
<strong><code>CamelScriptArguments</code></strong>.</p><p>Example:<plain-text-body>{snippet:id=e1|lang=java|url=camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/JavaScriptExpressionTest.java}</plain-text-body></p><h3
id="Ruby-UsingPropertiesFunction">Using Properties
Function</h3><p><strong>Available from Camel 2.9</strong></p><p>If you need to
use the <a shape="rect" href="properties.html">Properties</a> component from a
script to lookup property placeholders, then its a bit cumbersome to do so. For
example, to set a header name <strong><code>myHeader</code></strong> with
a value from a property placeholder, whose key is taken from a header named
<strong><code>foo</code></strong>.</p><p
lain-text-body>.setHeader("myHeader").groovy("context.resolvePropertyPlaceholders('{{'
+ request.headers.get('foo') + '}}')")
+</plain-text-body><p>From <strong>Camel 2.9</strong>: you can now use the
properties function and the same example is simpler:</p><parameter
ac:name="language">java</parameter><plain-text-body>.setHeader("myHeader").groovy("properties.resolve(request.headers.get('foo'))")
+</plain-text-body><h3 id="Ruby-LoadingScriptFromExternalResource">Loading
Script From External Resource</h3><p><strong>Available from Camel
2.11</strong></p><p>You can externalize the script and have Camel load it from
a resource such as <strong><code>classpath:</code></strong>,
<strong><code>file:</code></strong>, or <strong><code>http:</code></strong>.
This is done using the following syntax:
<strong><code>resource:scheme:location</code></strong> e.g. to refer to a file
on the classpath you can do:</p><parameter
ac:name="language">java</parameter><plain-text-body>.setHeader("myHeader").groovy("resource:classpath:mygroovy.groovy")
+</plain-text-body><h3
id="Ruby-HowtoGettheResultfromMultipleStatementsScript">How to Get the Result
from Multiple Statements Script</h3><p><strong>Available from Camel
2.14</strong></p><p>The script engine's eval method returns
a <strong><code>null</code></strong> when it runs a multi-statement
script. However, Camel can look up the value of a script's result by using the
key <strong><code>result</code></strong> from the value set. When writing a
multi-statement script set the value of
the <strong><code>result</code></strong> variable as the script return
value.</p><parameter ac:name="language">text</parameter><plain-text-body>bar =
"baz";
# some other statements ...
# camel take the result value as the script evaluation result
result = body * 2 + 1
-]]></script>
-</div></div><p> </p><h3 id="Ruby-Dependencies">Dependencies</h3><p>To use
scripting languages in your camel routes you need to add the a dependency on
<strong><code>camel-script</code></strong> which integrates the JSR-223
scripting engine.</p><p>If you use maven you could just add the following to
your <strong><code>pom.xml</code></strong>, substituting the version number for
the latest & greatest release (see <a shape="rect" href="download.html">the
download page for the latest versions</a>).</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[<dependency>
+</plain-text-body><p> </p><h3
id="Ruby-Dependencies">Dependencies</h3><p>To use scripting languages in your
camel routes you need to add the a dependency on
<strong><code>camel-script</code></strong> which integrates the JSR-223
scripting engine.</p><p>If you use maven you could just add the following to
your <strong><code>pom.xml</code></strong>, substituting the version number for
the latest & greatest release (see <a shape="rect" href="download.html">the
download page for the latest versions</a>).</p><parameter
ac:name="">xml</parameter><plain-text-body><dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-script</artifactId>
<version>x.x.x</version>
</dependency>
-]]></script>
-</div></div></div>
+</plain-text-body></div>
</td>
<td valign="top">
<div class="navigation">
Modified: websites/production/camel/content/sampling.html
==============================================================================
--- websites/production/camel/content/sampling.html (original)
+++ websites/production/camel/content/sampling.html Fri Aug 25 08:22:01 2017
@@ -36,17 +36,6 @@
<![endif]-->
- <link href='//camel.apache.org/styles/highlighter/styles/shCoreCamel.css'
rel='stylesheet' type='text/css' />
- <link href='//camel.apache.org/styles/highlighter/styles/shThemeCamel.css'
rel='stylesheet' type='text/css' />
- <script src='//camel.apache.org/styles/highlighter/scripts/shCore.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushJava.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushXml.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushPlain.js'
type='text/javascript'></script>
-
- <script type="text/javascript">
- SyntaxHighlighter.defaults['toolbar'] = false;
- SyntaxHighlighter.all();
- </script>
<title>
Apache Camel: Sampling
@@ -96,12 +85,9 @@ It is configured with a sampling period
<h3 id="Sampling-Options">Options</h3>
-<div class="confluenceTableSmall">
+<parameter ac:name="class">confluenceTableSmall</parameter><rich-text-body>
<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>messageFrequency</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> Samples the message every N'th
message. You can only use either frequency or period. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>samplePeriod</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>1</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Samples the
message every N'th period. You can only use either frequency or period.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>units</cod
e> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>SECOND</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> Time unit as an enum of
<code>java.util.concurrent.TimeUnit</code> from the JDK.
</p></td></tr></tbody></table></div>
-</div>
-
-
-
+</rich-text-body>
<h3 id="Sampling-Samples">Samples</h3>
@@ -109,73 +95,17 @@ It is configured with a sampling period
<p><strong>Using the <a shape="rect" href="fluent-builders.html">Fluent
Builders</a></strong><br clear="none">
These samples also show how you can use the different syntax to configure the
sampling period:</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:sample")
- .sample()
- .to("mock:result");
-
-from("direct:sample-configured")
- .sample(1, TimeUnit.SECONDS)
- .to("mock:result");
-
-from("direct:sample-configured-via-dsl")
- .sample().samplePeriod(1).timeUnits(TimeUnit.SECONDS)
- .to("mock:result");
-
-from("direct:sample-messageFrequency")
- .sample(10)
- .to("mock:result");
-
-from("direct:sample-messageFrequency-via-dsl")
- .sample().sampleMessageFrequency(5)
- .to("mock:result");
-
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=e1|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SamplingThrottlerTest.java}</plain-text-body>
<p><strong>Using the <a shape="rect" href="spring-xml-extensions.html">Spring
XML Extensions</a></strong><br clear="none">
And the same example in Spring XML is:</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:sample"/>
- <sample samplePeriod="1" units="seconds">
- <to uri="mock:result"/>
- </sample>
-</route>
-<route>
- <from uri="direct:sample-messageFrequency"/>
- <sample messageFrequency="10">
- <to uri="mock:result"/>
- </sample>
-</route>
-<route>
- <from uri="direct:sample-messageFrequency-via-dsl"/>
- <sample messageFrequency="5">
- <to uri="mock:result"/>
- </sample>
-</route>
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/samplingThrottler.xml}</plain-text-body>
<p>And since it uses a default of 1 second you can omit this configuration in
case you also want to use 1 second</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:sample"/>
- <!-- will by default use 1 second period -->
- <sample>
- <to uri="mock:result"/>
- </sample>
-</route>
-]]></script>
-</div></div>
-
+<plain-text-body>{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/samplingThrottlerWithDefault.xml}</plain-text-body>
-<h4 id="Sampling-UsingThisPattern">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>
+<parameter ac:name=""><a shape="rect" href="using-this-pattern.html">Using
This Pattern</a></parameter>
<h3 id="Sampling-SeeAlso">See Also</h3>
<ul class="alternate"><li><a shape="rect"
href="throttler.html">Throttler</a></li><li><a shape="rect"
href="aggregator.html">Aggregator</a></li></ul></div>
Modified: websites/production/camel/content/scala-dsl-eip.html
==============================================================================
--- websites/production/camel/content/scala-dsl-eip.html (original)
+++ websites/production/camel/content/scala-dsl-eip.html Fri Aug 25 08:22:01
2017
@@ -36,17 +36,6 @@
<![endif]-->
- <link href='//camel.apache.org/styles/highlighter/styles/shCoreCamel.css'
rel='stylesheet' type='text/css' />
- <link href='//camel.apache.org/styles/highlighter/styles/shThemeCamel.css'
rel='stylesheet' type='text/css' />
- <script src='//camel.apache.org/styles/highlighter/scripts/shCore.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushJava.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushXml.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushPlain.js'
type='text/javascript'></script>
-
- <script type="text/javascript">
- SyntaxHighlighter.defaults['toolbar'] = false;
- SyntaxHighlighter.all();
- </script>
<title>
Apache Camel: Scala DSL - EIP
@@ -86,59 +75,26 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><div class="confluence-information-macro
confluence-information-macro-information"><p class="title">DSL
supported</p><span class="aui-icon aui-icon-small aui-iconfont-info
confluence-information-macro-icon"></span><div
class="confluence-information-macro-body">
+<div class="wiki-content maincontent"><parameter ac:name="title">DSL
supported</parameter><rich-text-body>
<p>The <a shape="rect" href="scala-dsl.html">Scala DSL</a> supports
<strong>every</strong> DSL from the <a shape="rect" href="dsl.html">Java
DSL</a>.</p>
<p>On this page we have examples for a number of the <a shape="rect"
href="eip.html">EIP</a>s.<br clear="none">
-You can check the <a shape="rect" class="external-link"
href="https://svn.apache.org/repos/asf/camel/trunk/components/camel-scala/src/test/scala/">unit
test source code</a> for the Scala Component to find more
examples.</p></div></div>
+You can check the <a shape="rect" class="external-link"
href="https://svn.apache.org/repos/asf/camel/trunk/components/camel-scala/src/test/scala/">unit
test source code</a> for the Scala Component to find more
examples.</p></rich-text-body>
-<div class="toc-macro client-side-toc-macro"
data-headerelements="H3,H4,H5,H6,H7" data-cssliststyle="none"
data-numberedoutline="true"></div>
+<parameter ac:name="minLevel">3</parameter><parameter
ac:name="outline">true</parameter><parameter ac:name="style">none</parameter>
<h3 id="ScalaDSL-EIP-Messagingsystems">Messaging systems</h3>
-<h4 id="ScalaDSL-EIP-Pipelinepipeline">Pipeline <span
class="confluence-anchor-link" id="ScalaDSL-EIP-pipeline"></span></h4>
+<h4 id="ScalaDSL-EIP-Pipelinepipeline">Pipeline <parameter
ac:name="">pipeline</parameter></h4>
<p>There is a simple syntax available for specifying pipeline, by simple
putting <code>to</code> or <code>→</code> between the different steps in
the pipeline.</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[
-"direct:a" --> "mock:a" --> "mock:b"
-"direct:c" to "mock:c" to "mock:d"
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=simple|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/PipelineRouteBuilderTest.scala}</plain-text-body>
<p>For more advanced use cases, you can also use a block-based syntax, where
every step in the pipeline starts with either <code>to</code> or
<code>→</code>.</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[
-"direct:e" ==> {
- --> ("mock:e")
- --> ("mock:f")
-}
-
-"direct:g" ==> {
- to ("mock:g")
- to ("mock:h")
-}
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=block|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/PipelineRouteBuilderTest.scala}</plain-text-body>
-<h4 id="ScalaDSL-EIP-Filterfilter">Filter <span class="confluence-anchor-link"
id="ScalaDSL-EIP-filter"></span></h4>
+<h4 id="ScalaDSL-EIP-Filterfilter">Filter <parameter
ac:name="">filter</parameter></h4>
<p>For a message filter, use the <code>when()</code> method with a parameter
of type The <code>Exchange ⇒ Boolean</code>. In the example below, we use
a Scala convenience method named <code>in</code> to access the 'in' message
body; only messages where the 'in' message is <code><hello/></code> will
arrive at the <code>mock:a</code> endpoint.</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[
-"direct:a" when(_.in == "<hello/>")
to("mock:a")
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=simple|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/FilterRouteBuilderTest.scala}</plain-text-body>
<p>Once again, if you need to specify a more advanced route, you can use the
more elaborate syntax.</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[
-"direct:b" ==> {
- when(_.in == "<hallo/>") {
- --> ("mock:b")
- to ("mock:c")
- } otherwise {
- to ("mock:e")
- }
- to ("mock:d")
-}
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=alternatives|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/FilterRouteBuilderTest.scala}</plain-text-body>
<h3 id="ScalaDSL-EIP-Messagingchannels">Messaging channels</h3>
@@ -146,211 +102,78 @@ You can check the <a shape="rect" class=
<p>The <a shape="rect" class="external-link"
href="http://www.eaipatterns.com/DeadLetterChannel.html" rel="nofollow">dead
letter channel</a> can be created with the syntax similar to the one used in <a
shape="rect" class="external-link"
href="http://camel.apache.org/dead-letter-channel.html">Java DSL</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["jms:in"
errorHandler(deadLetterChannel("jms:error")) to
"jms:out"]]></script>
-</div></div>
+<parameter ac:name="">java</parameter><plain-text-body>"jms:in"
errorHandler(deadLetterChannel("jms:error")) to "jms:out"</plain-text-body>
<p>You can also use different error handler available for the <a shape="rect"
class="external-link" href="http://camel.apache.org/error-handler.html">Java
DSL</a>. In particular Scala DSL supports <a shape="rect" class="external-link"
href="http://camel.apache.org/defaulterrorhandler.html">DefaultErrorHandler</a>
and <a shape="rect" class="external-link"
href="http://camel.apache.org/error-handler.html#ErrorHandler-LoggingErrorHandler">LoggingErrorHandler</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[// DefaultErrorHandler
-"jms:in" errorHandler(defaultErrorHandler) to "jms:out"
+<parameter ac:name="">java</parameter><plain-text-body>// DefaultErrorHandler
+"jms:in" errorHandler(defaultErrorHandler) to "jms:out"
// LoggingErrorHandler
-"jms:in"
errorHandler(loggingErrorHandler.level(LoggingLevel.INFO).logName("com.example.MyLogger"))
to "jms:out"
-]]></script>
-</div></div>
+"jms:in"
errorHandler(loggingErrorHandler.level(LoggingLevel.INFO).logName("com.example.MyLogger"))
to "jms:out"
+</plain-text-body>
<h3 id="ScalaDSL-EIP-Messagerouting">Message routing</h3>
<h4 id="ScalaDSL-EIP-Aggregator">Aggregator</h4>
<p>The aggregator EIP aggregates messages based on some message correlation
criteria. In the Scala DSL, the <code>aggregate</code> method takes a function
<code>Exchange ⇒ Any</code> to determine the correlation value for the
exchange. In the sample below, message are being aggregated if the first 7
letters in the message body are the same.</p>
-<div class="error"><span class="error">Error formatting macro: snippet:
java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>
+<plain-text-body>{snippet:id=block|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/AggregatorTest.scala}</plain-text-body>
<h4 id="ScalaDSL-EIP-Contentbasedrouter">Content based router</h4>
<p>Similar to the <a shape="rect" href="#ScalaDSL-EIP-filter">Filter </a>, the
content based router uses <code>when</code> methods with <code>Exchange ⇒
Boolean</code> function literals and an optional <code>otherwise</code>. The
function literal can contain plain Scala code as well as any of the <a
shape="rect" href="scala-dsl-supported-languages.html">supported languages
</a>. The example below routes a given message based on the language of the
message body.</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[
- "direct:a" ==> {
- to ("mock:polyglot")
- choice {
- when (_.in == "<hello/>") to ("mock:english")
- when (_.in == "<hallo/>") {
- to ("mock:dutch")
- to ("mock:german")
- }
- otherwise to ("mock:french")
- }
-}
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=cbr|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/ContentBasedRouterTest.scala}</plain-text-body>
<h4 id="ScalaDSL-EIP-Delayer">Delayer</h4>
<p>Unlike a throttler, which only slows down messages if the rate exceeds a
treshold, a delayer delays every messages with a fixed amount of time. An
example: to delay every message going from <code>seda:a</code> to
<code>mock:a</code> with 1 second, you write...</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[
-"seda:a" delay(1 seconds) to ("mock:a")
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=simple|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/DelayerTest.scala}</plain-text-body>
<p>Our second example will delay the entire block (containing
<code>mock:c</code>) without doing anything to <code>mock:b</code></p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[
-"seda:b" ==> {
- to ("mock:b")
- delay(1 seconds) {
- to ("mock:c")
- }
-}
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=block|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/DelayerTest.scala}</plain-text-body>
<h4 id="ScalaDSL-EIP-Loadbalancer">Load balancer</h4>
<p>To distribute the message handling load over multiple endpoints, we add a
<code>loadbalance</code> to our route definition. You can optionally specify a
load balancer strategy, like <code>roundrobin</code></p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default"
type="syntaxhighlighter"><![CDATA[
-"direct:a" ==> {
- loadbalance roundrobin {
- to ("mock:a")
- to ("mock:b")
- to ("mock:c")
- }
-}
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=loadbalance|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/LoadBalancerTest.scala}</plain-text-body>
<h4 id="ScalaDSL-EIP-Multicast">Multicast</h4>
<p>Multicast allows you to send a message to multiple endpoints at the same
time. In a simple route, you can specify multiple targets in the
<code>to</code> or <code>→</code> method call:</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[
-"direct:a" --> ("mock:a", "mock:b") -->
"mock:c"
-"direct:d" to ("mock:d", "mock:e") to
"mock:f"
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=simple|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/PipelineAndMulticastTest.scala}</plain-text-body>
<h4 id="ScalaDSL-EIP-Recipientlist">Recipient list</h4>
<p>You can handle a static recipient list with a multicast or <a shape="rect"
href="#ScalaDSL-EIP-pipeline">pipeline </a>, but this EIP is usually applied
when you want to dynamically determine the name(s) of the next endpoint(s) to
route to. Use the <code>recipients()</code> method with a function literal
(<code>Exchange => Any</code>) that returns the endpoint name(s). In the
example below, the target endpoint name can be found in the String message
starting at position 21.</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[
-"direct:a" recipients(_.in[String].substring(21))
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=simple|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/RecipientListRouteTest.scala}</plain-text-body>
<p>Because the <code>recipients()</code> method just takes a function literal,
you can basically use any kind of valid Scala code to determine the endpoint
name. Have a look at the next example which uses pattern matching to figure
out where to send the message:</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[
-"direct:b" recipients(_.getIn.getBody match {
- case Toddler(_) => "mock:playgarden"
- case _ => "mock:work"
-})
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=pattern|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/RecipientListRouteTest.scala}</plain-text-body>
<p>Again, we can also use the same thing in a more block-like syntax. For
this example, we use the Scala DSL's <a shape="rect"
href="scala-dsl-supported-languages.html">support for JXPath</a> to determine
the target.</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[
-"direct:c" ==> {
- to("mock:c")
- recipients(jxpath("./in/body/destination"))
-}
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=block|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/RecipientListRouteTest.scala}</plain-text-body>
<h4 id="ScalaDSL-EIP-Resequencer">Resequencer</h4>
<p>Use the <code>resequence</code> method to add a resequencer to the
RouteBuilder. The method takes a function (<code>Exchange ⇒ Unit</code>)
that determines the value to resequence on. In this example, we resequence
messages based on the 'in' message body.</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[
-"direct:a" resequence (_.in) to "mock:a"
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=simple|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/ResequencerTest.scala}</plain-text-body>
<p>The same EIP can also be used with a block-like syntax...</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[
-"direct:b" ==> {
- to ("mock:b")
- resequence (_.in) {
- to ("mock:c")
- }
-}
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=block|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/ResequencerTest.scala}</plain-text-body>
<p>... and with configurable batch size. In this last example, messages will
be send to <code>mock:e</code> whenever a batch of 5 messages is available.</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[
-"direct:d" ==> {
- to ("mock:d")
- resequence(_.in).batch(5) {
- to ("mock:e")
- }
-}
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=batch|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/ResequencerTest.scala}</plain-text-body>
<h4 id="ScalaDSL-EIP-Splitter">Splitter</h4>
<p>To handle large message in smaller chunks, you can write a Scala
<code>Exchange ⇒ Any*</code> method and add it to your route with the
<code>splitter</code> method. As with many other EIPs, we support a short,
in-line version as well as a more elaborate block based one.</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[
-"direct:a" as(classOf[Document])
split(xpath("/persons/person")) to "mock:a"
-]]></script>
-</div></div>
-<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[
-"direct:b" ==> {
- as(classOf[Document])
- split(xpath("/persons/person")) {
- to("mock:b")
- to("mock:c")
- }
-}
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=simple|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/SplitterRouteBuilderTest.scala}</plain-text-body>
+<plain-text-body>{snippet:id=block|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/SplitterRouteBuilderTest.scala}</plain-text-body>
<p>The above examples also show you how <a shape="rect"
href="scala-dsl-supported-languages.html">other languages </a> like XPath can
be within the Scala DSL.</p>
<h4 id="ScalaDSL-EIP-Throttler">Throttler</h4>
<p>The throttler allows you to slow down messages before sending them along.
The <code>throttle</code> methods allows you to specify the maximum throughput
rate of message:</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[
-"seda:a" throttle (3 per (2 seconds)) to ("mock:a")
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=simple|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/ThrottlerTest.scala}</plain-text-body>
<p>It can also be used in front of block to throttle messages at that point.
In the example below, message are passed on to <code>mock:b</code> in a normal
rate (i.e. as fast as possible), but a maximum 3 messages/2 seconds will arrive
at the <code>mock:c</code> endpoint.</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[
-"seda:b" ==> {
- to ("mock:b")
- throttle (3 per (2 seconds)) {
- to ("mock:c")
- }
-}
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=block|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/ThrottlerTest.scala}</plain-text-body>
<h3 id="ScalaDSL-EIP-Messagetransformation">Message transformation</h3>
<h4 id="ScalaDSL-EIP-Contentenricher">Content enricher</h4>
<p>Using a processor function (<code>Exchange → Unit</code>), you can
alter/enrich the message content. This example uses a simple function literal
to append <code>" says Hello"</code> to the message content:</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[
-"direct:a" process(_.in += " says hello") to
("mock:a")
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=simple|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/ContentEnricherTest.scala}</plain-text-body>
<p>However, you can also define a separate method/function to handle the
transformation and pass that to the <code>process</code> method instead. The
example below uses pattern matching to enrich the message content:</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[
-val myProcessor = (exchange: Exchange) => {
- exchange.in match {
- case "hello" => exchange.in = "hello from the UK"
- case "hallo" => exchange.in = "hallo vanuit Belgie"
- case "bonjour" => exchange.in = "bonjour de la douce
France"
- }
-}
-
-"direct:b" process(myProcessor) to ("mock:b")
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=def|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/ContentEnricherTest.scala}</plain-text-body>
<p>Off course, you can also use any other Camel component (e.g. <a
shape="rect" href="velocity.html">Velocity</a>) to enrich the content and add
it to a pipeline</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[
-"direct:c" to
("velocity:org/apache/camel/scala/dsl/enricher.vm") to
("mock:c")
-]]></script>
-</div></div></div>
+<plain-text-body>{snippet:id=velocity|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/ContentEnricherTest.scala}</plain-text-body></div>
</td>
<td valign="top">
<div class="navigation">
Modified: websites/production/camel/content/scala-dsl-getting-started.html
==============================================================================
--- websites/production/camel/content/scala-dsl-getting-started.html (original)
+++ websites/production/camel/content/scala-dsl-getting-started.html Fri Aug 25
08:22:01 2017
@@ -36,17 +36,6 @@
<![endif]-->
- <link href='//camel.apache.org/styles/highlighter/styles/shCoreCamel.css'
rel='stylesheet' type='text/css' />
- <link href='//camel.apache.org/styles/highlighter/styles/shThemeCamel.css'
rel='stylesheet' type='text/css' />
- <script src='//camel.apache.org/styles/highlighter/scripts/shCore.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushJava.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushXml.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushPlain.js'
type='text/javascript'></script>
-
- <script type="text/javascript">
- SyntaxHighlighter.defaults['toolbar'] = false;
- SyntaxHighlighter.all();
- </script>
<title>
Apache Camel: Scala DSL - Getting Started
@@ -86,23 +75,10 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><p>Just like the <a shape="rect"
href="dsl.html">Java DSL</a>, the Scala DSL has a RouteBuilder class
(<code>org.apache.camel.scala.dsl.builder.RouteBuilder</code>) that you can
extend to implement your own routes. This example shows two very simple
routes:</p><div class="confluence-information-macro
confluence-information-macro-information"><span class="aui-icon aui-icon-small
aui-iconfont-info confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>From <strong>Camel 2.15</strong>
onwards use <span>org.apache.camel.scala.dsl.builder.ScalaRouteBuilder and pass
in the CamelContext in the constructor, which will be used by the builder. The
old class RouteBuilder is deprecated.
</span></p></div></div><p> </p><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[
-class MyRouteBuilder extends RouteBuilder {
- "direct:a" --> "mock:a"
- "direct:b" to "mock:b"
-}
-]]></script>
-</div></div><p>If you compare this to the Java <a shape="rect"
href="dsl.html">DSL</a>, you notice:</p><ul><li>there is no configure() method
to override</li><li>a route starts directly with a URI instead of
<code>from(uri)</code></li><li><code>→</code> is just an alias for
<code>to</code></li></ul><h3
id="ScalaDSL-GettingStarted-SettingtherouteID">Setting the route ID</h3><p>To
assign the unique ID to the Scala route, insert the <code>routeId</code> method
invocation after the "from" part of the DSL.</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[ "direct:a" routeId
"route-b" to "mock:b"
-]]></script>
-</div></div><h3
id="ScalaDSL-GettingStarted-CreatinganewCamelScalaproject">Creating a new Camel
Scala project</h3><p>Camel offers <a shape="rect"
href="camel-maven-archetypes.html">Maven archetypes</a> that allow you to
quickly setup a new project.</p><p>To do this, you can execute the following
Maven goal from the command line (using Maven 3.0.3 or better):</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[mvn archetype:generate
-]]></script>
-</div></div><p>This runs Maven interactively - just type <code>camel</code>
and press <Enter> to filter for Camel-related archetypes.<br
clear="none"> From the list, pick the number for
<code>camel-archetype-scala</code>, then fill in the remaining details (such as
the Camel version, <em>et cetera</em>).</p><p>The generated project has a
"readme" file with more instructions, and is ready to compile and run from
Maven using:</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[mvn compile exec:java
-]]></script>
-</div></div></div>
+<div class="wiki-content maincontent"><p>Just like the <a shape="rect"
href="dsl.html">Java DSL</a>, the Scala DSL has a RouteBuilder class
(<code>org.apache.camel.scala.dsl.builder.RouteBuilder</code>) that you can
extend to implement your own routes. This example shows two very simple
routes:</p><rich-text-body><p>From <strong>Camel 2.15</strong> onwards use
<span>org.apache.camel.scala.dsl.builder.ScalaRouteBuilder and pass in the
CamelContext in the constructor, which will be used by the builder. The old
class RouteBuilder is deprecated.
</span></p></rich-text-body><p> </p><p> </p><plain-text-body>{snippet:id=basic|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/BasicRouteBuilderTest.scala}</plain-text-body><p>If
you compare this to the Java <a shape="rect" href="dsl.html">DSL</a>, you
notice:</p><ul><li>there is no configure() method to override</li><li>a route
starts directly with a URI instead of <code>from(uri)</code></li>
<li><code>→</code> is just an alias for <code>to</code></li></ul><h3
id="ScalaDSL-GettingStarted-SettingtherouteID">Setting the route ID</h3><p>To
assign the unique ID to the Scala route, insert the <code>routeId</code> method
invocation after the "from" part of the DSL.</p><plain-text-body> "direct:a"
routeId "route-b" to "mock:b"
+</plain-text-body><h3
id="ScalaDSL-GettingStarted-CreatinganewCamelScalaproject">Creating a new Camel
Scala project</h3><p>Camel offers <a shape="rect"
href="camel-maven-archetypes.html">Maven archetypes</a> that allow you to
quickly setup a new project.</p><p>To do this, you can execute the following
Maven goal from the command line (using Maven 3.0.3 or
better):</p><plain-text-body>mvn archetype:generate
+</plain-text-body><p>This runs Maven interactively - just type
<code>camel</code> and press <Enter> to filter for Camel-related
archetypes.<br clear="none"> From the list, pick the number for
<code>camel-archetype-scala</code>, then fill in the remaining details (such as
the Camel version, <em>et cetera</em>).</p><p>The generated project has a
"readme" file with more instructions, and is ready to compile and run from
Maven using:</p><plain-text-body>mvn compile exec:java
+</plain-text-body></div>
</td>
<td valign="top">
<div class="navigation">
Modified: websites/production/camel/content/scala-dsl-supported-languages.html
==============================================================================
--- websites/production/camel/content/scala-dsl-supported-languages.html
(original)
+++ websites/production/camel/content/scala-dsl-supported-languages.html Fri
Aug 25 08:22:01 2017
@@ -36,17 +36,6 @@
<![endif]-->
- <link href='//camel.apache.org/styles/highlighter/styles/shCoreCamel.css'
rel='stylesheet' type='text/css' />
- <link href='//camel.apache.org/styles/highlighter/styles/shThemeCamel.css'
rel='stylesheet' type='text/css' />
- <script src='//camel.apache.org/styles/highlighter/scripts/shCore.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushJava.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushXml.js'
type='text/javascript'></script>
- <script src='//camel.apache.org/styles/highlighter/scripts/shBrushPlain.js'
type='text/javascript'></script>
-
- <script type="text/javascript">
- SyntaxHighlighter.defaults['toolbar'] = false;
- SyntaxHighlighter.all();
- </script>
<title>
Apache Camel: Scala DSL - Supported languages
@@ -92,28 +81,11 @@
<h4 id="ScalaDSL-Supportedlanguages-Using">Using <a shape="rect"
href="xpath.html">XPath</a></h4>
<p>With the XPath trait, you have an additional method available on an
<code>Exchange</code> to do XPath queries against the message. Just look at
this Splitter example, where the <code>xpath</code> method is used in a
<code>Exchange ⇒ Any*</code> function literal</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[
-"direct:b" ==> {
- as(classOf[Document])
- split(xpath("/persons/person")) {
- to("mock:b")
- to("mock:c")
- }
-}
-]]></script>
-</div></div>
+<plain-text-body>{snippet:id=block|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/SplitterRouteBuilderTest.scala}</plain-text-body>
<h4 id="ScalaDSL-Supportedlanguages-Using.1">Using <a shape="rect"
href="jxpath.html">JXPath</a></h4>
<p>With the <code>org.apache.camel.scala.dsl.languages.JXPath</code> trait,
you can an additional <code>jxpath</code> method on the <code>Exchange</code>.
In the Recipient List example below, JXPath is used for getting the next
endpoint's name out of the message body.</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[
-"direct:c" ==> {
- to("mock:c")
- recipients(jxpath("./in/body/destination"))
-}
-]]></script>
-</div></div></div>
+<plain-text-body>{snippet:id=block|lang=java|url=camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/RecipientListRouteTest.scala}</plain-text-body></div>
</td>
<td valign="top">
<div class="navigation">