Modified: websites/production/camel/content/quartz.html
==============================================================================
--- websites/production/camel/content/quartz.html (original)
+++ websites/production/camel/content/quartz.html Tue Mar 26 22:22:28 2019
@@ -89,7 +89,7 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="Quartz-QuartzComponent">Quartz
Component</h2><p>The <strong>quartz:</strong> component provides a scheduled
delivery of messages using the <a shape="rect" class="external-link"
href="http://www.quartz-scheduler.org/" rel="nofollow">Quartz Scheduler 1.x
</a>. <br clear="none"> Each endpoint represents a different timer (in Quartz
terms, a Trigger and JobDetail).</p><div class="confluence-information-macro
confluence-information-macro-tip conf-macro output-block" data-hasbody="true"
data-macro-name="tip"><span class="aui-icon aui-icon-small aui-iconfont-approve
confluence-information-macro-icon"> </span><div
class="confluence-information-macro-body"><p>If you are using Quartz 2.x then
from Camel 2.12 onwards there is a <a shape="rect"
href="quartz2.html">Quartz2</a> component you should
use</p></div></div><p>Maven users will need to add the following dependency to
their <code>pom.xml</code> for this component:</p><div class="code panel pdl
conf-macro output-block" data-hasbody="true" data-macro-name="code"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<div class="wiki-content maincontent"><h2 id="Quartz-QuartzComponent">Quartz
Component</h2><p>The <strong>quartz:</strong> component provides a scheduled
delivery of messages using the <a shape="rect" class="external-link"
href="http://www.quartz-scheduler.org/" rel="nofollow">Quartz Scheduler 1.x
</a>. <br clear="none"> Each endpoint represents a different timer (in Quartz
terms, a Trigger and JobDetail).</p><div class="confluence-information-macro
confluence-information-macro-tip conf-macro output-block" data-hasbody="true"
data-macro-name="tip"><span class="aui-icon aui-icon-small aui-iconfont-approve
confluence-information-macro-icon"> </span><div
class="confluence-information-macro-body"><p>If you are using Quartz 2.x then
from Camel 2.12 onwards there is a <a shape="rect"
href="quartz2.html">Quartz2</a> component you should
use</p></div></div><p>Maven users will need to add the following dependency to
their <code>pom.xml</code> for this component:</p><div class="code panel pdl
conf-macro output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default"><dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-quartz</artifactId>
@@ -97,7 +97,7 @@
<!-- use the same version as your Camel core version -->
</dependency>
</pre>
-</div></div><h3 id="Quartz-URIformat">URI format</h3><div class="code panel
pdl conf-macro output-block" data-hasbody="true" data-macro-name="code"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="Quartz-URIformat">URI format</h3><div class="code panel
pdl conf-macro output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">quartz://timerName?options
quartz://groupName/timerName?options
quartz://groupName/timerName?cron=expression
@@ -109,7 +109,7 @@ quartz://timerName?cron=expression
<p>For example, the following routing rule will fire two timer events to the
<code>mock:results</code> endpoint:</p><div class="error conf-macro
output-inline" data-hasbody="true"
data-macro-name="unmigrated-inline-wiki-markup"><span class="error">Error
formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20,
Size: 20</span> </div><p>When using a <a shape="rect" class="external-link"
href="http://quartz-scheduler.org/api/2.0.0/org/quartz/StatefulJob.html"
rel="nofollow">StatefulJob</a>, the <a shape="rect" class="external-link"
href="http://quartz-scheduler.org/api/2.0.0/org/quartz/JobDataMap.html"
rel="nofollow">JobDataMap</a> is re-persisted after every execution of the job,
thus preserving state for the next execution.</p><div
class="confluence-information-macro confluence-information-macro-information
conf-macro output-block" data-hasbody="true" data-macro-name="info"><p
class="title">Running in OSGi and having multiple bundles with quartz
routes</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 run in OSGi such as Apache
ServiceMix, or Apache Karaf, and have multiple bundles with Camel routes that
start from <a shape="rect" href="quartz.html">Quartz</a> endpoints, then make
sure if you assign<br clear="none"> an <code>id</code> to the
<camelContext> that this id is unique, as this is required by the
<code>QuartzScheduler</code> in the OSGi container. If you do not set any
<code>id</code> on <camelContext> then<br clear="none"> a unique id is
auto assigned, and there is no problem.</p></div></div><h3
id="Quartz-Configuringquartz.propertiesfile">Configuring quartz.properties
file</h3><p>By default Quartz will look for a <code>quartz.properties</code>
file in the <code>org/quartz</code> directory of the classpath. If you are
using WAR deployments this means just drop the quartz.properties in
<code>WEB-INF/classes/org/quart
z</code>.</p><p>However the Camel <a shape="rect"
href="quartz.html">Quartz</a> component also allows you to configure
properties:</p><div class="confluenceTableSmall conf-macro output-block"
data-hasbody="true" data-macro-name="div"><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>Parameter</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>properties</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1"
class="confluenceTd"><p><code>Properties</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><strong>Camel 2.4</strong>: You can
configure a <code>java.util.Properties</code> instance.</p></td></tr><tr><td co
lspan="1" rowspan="1"
class="confluenceTd"><p><code>propertiesFile</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p><strong>Camel 2.4</strong>: File name of
the properties to load from the
classpath</p></td></tr></tbody></table></div></div>
-<p>To do this you can configure this in Spring XML as follows</p><div
class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<p>To do this you can configure this in Spring XML as follows</p><div
class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default"><bean id="quartz"
class="org.apache.camel.component.quartz.QuartzComponent">
<property name="propertiesFile"
value="com/mycompany/myquartz.properties"/>
</bean>
@@ -117,21 +117,21 @@ quartz://timerName?cron=expression
</div></div><h3 id="Quartz-EnablingQuartzschedulerinJMX">Enabling Quartz
scheduler in JMX</h3><p>You need to configure the quartz scheduler properties
to enable JMX.<br clear="none"> That is typically setting the option
<code>"org.quartz.scheduler.jmx.export"</code> to a <code>true</code> value in
the configuration file.</p><p>From Camel 2.13 onwards Camel will automatic set
this option to true, unless explicit disabled.</p><h3
id="Quartz-StartingtheQuartzscheduler">Starting the Quartz
scheduler</h3><p><strong>Available as of Camel 2.4</strong></p><p>The <a
shape="rect" href="quartz.html">Quartz</a> component offers an option to let
the Quartz scheduler be started delayed, or not auto started at all.</p><div
class="confluenceTableSmall conf-macro output-block" data-hasbody="true"
data-macro-name="div"><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>Parameter</p></th><th colspan="1" rowspan="1"
class="confluenceTh"
><p>Default</p></th><th colspan="1" rowspan="1"
>class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1"
>class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1"
>rowspan="1"
>class="confluenceTd"><p><code>startDelayedSeconds</code></p></td><td
>colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td
>colspan="1" rowspan="1" class="confluenceTd"><p><code>int</code></p></td><td
>colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4</strong>:
>Seconds to wait before starting the quartz scheduler.</p></td></tr><tr><td
>colspan="1" rowspan="1"
>class="confluenceTd"><p><code>autoStartScheduler</code></p></td><td
>colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td
>colspan="1" rowspan="1"
>class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1"
>rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> Whether or
>not the scheduler should be auto
>started.</p></td></tr></tbody></table></div></div>
-<p>To do this you can configure this in Spring XML as follows</p><div
class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<p>To do this you can configure this in Spring XML as follows</p><div
class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default"><bean id="quartz"
class="org.apache.camel.component.quartz.QuartzComponent">
<property name="startDelayedSeconds" value="5"/>
</bean>
</pre>
-</div></div><h3 id="Quartz-Clustering">Clustering</h3><p><strong>Available as
of Camel 2.4</strong></p><p>If you use Quartz in clustered mode, e.g. the
<code>JobStore</code> is clustered. Then from Camel 2.4 onwards the <a
shape="rect" href="quartz.html">Quartz</a> component will <strong>not</strong>
pause/remove triggers when a node is being stopped/shutdown. This allows the
trigger to keep running on the other nodes in the
cluster.</p><p><strong>Note</strong>: When running in clustered node no
checking is done to ensure unique job name/group for endpoints.</p><h3
id="Quartz-MessageHeaders">Message Headers</h3><p>Camel adds the getters from
the Quartz Execution Context as header values. The following headers are
added:<br clear="none"> <code>calendar</code>, <code>fireTime</code>,
<code>jobDetail</code>, <code>jobInstance</code>, <code>jobRuntTime</code>,
<code>mergedJobDataMap</code>, <code>nextFireTime</code>,
<code>previousFireTime</code>, <code>refireCount</code>, <code>result<
/code>, <code>scheduledFireTime</code>, <code>scheduler</code>,
<code>trigger</code>, <code>triggerName</code>,
<code>triggerGroup</code>.</p><p>The <code>fireTime</code> header contains the
<code>java.util.Date</code> of when the exchange was fired.</p><h3
id="Quartz-UsingCronTriggers">Using Cron Triggers</h3><p>Quartz supports <a
shape="rect" class="external-link"
href="http://www.quartz-scheduler.org/documentation/quartz-2.1.x/tutorials/crontrigger"
rel="nofollow">Cron-like expressions</a> for specifying timers in a handy
format. You can use these expressions in the <code>cron</code> URI parameter;
though to preserve valid URI encoding we allow + to be used instead of spaces.
Quartz provides a <a shape="rect" class="external-link"
href="http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html"
rel="nofollow">little tutorial</a> on how to use cron expressions.</p><p>For
example, the following will fire a message every five minutes starting at 12pm
(noon) to 6pm on weekdays:
</p><div class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><h3 id="Quartz-Clustering">Clustering</h3><p><strong>Available as
of Camel 2.4</strong></p><p>If you use Quartz in clustered mode, e.g. the
<code>JobStore</code> is clustered. Then from Camel 2.4 onwards the <a
shape="rect" href="quartz.html">Quartz</a> component will <strong>not</strong>
pause/remove triggers when a node is being stopped/shutdown. This allows the
trigger to keep running on the other nodes in the
cluster.</p><p><strong>Note</strong>: When running in clustered node no
checking is done to ensure unique job name/group for endpoints.</p><h3
id="Quartz-MessageHeaders">Message Headers</h3><p>Camel adds the getters from
the Quartz Execution Context as header values. The following headers are
added:<br clear="none"> <code>calendar</code>, <code>fireTime</code>,
<code>jobDetail</code>, <code>jobInstance</code>, <code>jobRuntTime</code>,
<code>mergedJobDataMap</code>, <code>nextFireTime</code>,
<code>previousFireTime</code>, <code>refireCount</code>, <code>result<
/code>, <code>scheduledFireTime</code>, <code>scheduler</code>,
<code>trigger</code>, <code>triggerName</code>,
<code>triggerGroup</code>.</p><p>The <code>fireTime</code> header contains the
<code>java.util.Date</code> of when the exchange was fired.</p><h3
id="Quartz-UsingCronTriggers">Using Cron Triggers</h3><p>Quartz supports <a
shape="rect" class="external-link"
href="http://www.quartz-scheduler.org/documentation/quartz-2.1.x/tutorials/crontrigger"
rel="nofollow">Cron-like expressions</a> for specifying timers in a handy
format. You can use these expressions in the <code>cron</code> URI parameter;
though to preserve valid URI encoding we allow + to be used instead of spaces.
Quartz provides a <a shape="rect" class="external-link"
href="http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html"
rel="nofollow">little tutorial</a> on how to use cron expressions.</p><p>For
example, the following will fire a message every five minutes starting at 12pm
(noon) to 6pm on weekdays:
</p><div class="code panel pdl conf-macro output-block" style="border-width:
1px;" data-hasbody="true" data-macro-name="code"><div class="codeContent
panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default"
data-theme="Default">from("quartz://myGroup/myTimerName?cron=0+0/5+12-18+?+*+MON-FRI").to("activemq:Totally.Rocks");
</pre>
-</div></div><p>which is equivalent to using the cron expression</p><div
class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><p>which is equivalent to using the cron expression</p><div
class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">0 0/5 12-18 ? * MON-FRI
</pre>
</div></div><p>The following table shows the URI character encodings we use to
preserve valid URI syntax:</p><div class="confluenceTableSmall conf-macro
output-block" data-hasbody="true" data-macro-name="div"><div
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1"
rowspan="1" class="confluenceTh"><p>URI Character</p></th><th colspan="1"
rowspan="1" class="confluenceTh"><p>Cron character</p></th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>+</code></p></td><td
colspan="1" rowspan="1"
class="confluenceTd"><p><em>Space</em></p></td></tr></tbody></table></div></div>
-<h3 id="Quartz-Specifyingtimezone">Specifying time
zone</h3><p><strong>Available as of Camel 2.8.1</strong><br clear="none"> The
Quartz Scheduler allows you to configure time zone per trigger. For example to
use a timezone of your country, then you can do as follows:</p><div class="code
panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<h3 id="Quartz-Specifyingtimezone">Specifying time
zone</h3><p><strong>Available as of Camel 2.8.1</strong><br clear="none"> The
Quartz Scheduler allows you to configure time zone per trigger. For example to
use a timezone of your country, then you can do as follows:</p><div class="code
panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default"
data-theme="Default">quartz://groupName/timerName?cron=0+0/5+12-18+?+*+MON-FRI&trigger.timeZone=Europe/Stockholm
</pre>
</div></div><p>The timeZone value is the values accepted by
<code>java.util.TimeZone</code>.</p><p>In Camel 2.8.0 or older versions you
would have to provide your custom <code>String</code> to
<code>java.util.TimeZone</code> <a shape="rect" href="type-converter.html">Type
Converter</a> to be able configure this from the endpoint uri.<br clear="none">
From Camel 2.8.1 onwards we have included such a <a shape="rect"
href="type-converter.html">Type Converter</a> in the camel-core.</p><p></p><div
class="conf-macro output-block" data-hasbody="false"
data-macro-name="include"><h3 id="Quartz-SeeAlso">See Also</h3>
Modified: websites/production/camel/content/ref.html
==============================================================================
--- websites/production/camel/content/ref.html (original)
+++ websites/production/camel/content/ref.html Tue Mar 26 22:22:28 2019
@@ -95,7 +95,7 @@
<h3 id="Ref-URIformat">URI format</h3>
-<div class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<div class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">
ref:someName[?options]
</pre>
@@ -105,7 +105,7 @@ ref:someName[?options]
<h3 id="Ref-Runtimelookup">Runtime lookup</h3>
<p>This component can be used when you need dynamic discovery of endpoints in
the <a shape="rect" href="registry.html">Registry</a> where you can compute the
URI at runtime. Then you can look up the endpoint using the following code:</p>
-<div class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<div class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">
// lookup the endpoint
String myEndpointRef = "bigspenderOrder";
@@ -122,7 +122,7 @@ ref:someName[?options]
<p>And you could have a list of endpoints defined in the <a shape="rect"
href="registry.html">Registry</a> such as:</p>
-<div class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<div class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">
<camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">
<endpoint id="normalOrder" uri="activemq:order.slow"/>
@@ -154,7 +154,7 @@ Error rendering macro 'code': Invalid va
<p>You could, of course, have used the <code>ref</code> attribute instead:</p>
-<div class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<div class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">
<to ref="endpoint2"/>
</pre>
Modified: websites/production/camel/content/request-reply.html
==============================================================================
--- websites/production/camel/content/request-reply.html (original)
+++ websites/production/camel/content/request-reply.html Tue Mar 26 22:22:28
2019
@@ -109,7 +109,7 @@
<p>You can explicitly force an endpoint to be in Request Reply mode by setting
the exchange pattern on the URI. e.g.</p>
-<div class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<div class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">
jms:MyQueue?exchangePattern=InOut
</pre>
Modified: websites/production/camel/content/route-throttling-example.html
==============================================================================
--- websites/production/camel/content/route-throttling-example.html (original)
+++ websites/production/camel/content/route-throttling-example.html Tue Mar 26
22:22:28 2019
@@ -151,7 +151,7 @@ Error rendering macro 'code': Invalid va
For example you can change the option <code>maxInflightExchanges</code> while
its running to find a more suitable value.</p>
<p>The screenshot below illustrates it from a JConsole.<br clear="none">
-<span class="confluence-embedded-file-wrapper"><img
class="confluence-embedded-image"
src="route-throttling-example.data/throttling%20services.png"
data-image-src="/confluence/download/attachments/5604305/throttling%20services.png?version=1&modificationDate=1257166177000&api=v2"
data-unresolved-comment-count="0" data-linked-resource-id="5865480"
data-linked-resource-version="1" data-linked-resource-type="attachment"
data-linked-resource-default-alias="throttling services.png"
data-base-url="https://cwiki.apache.org/confluence"
data-linked-resource-content-type="image/png"
data-linked-resource-container-id="5604305"
data-linked-resource-container-version="29"></span></p>
+<span class="confluence-embedded-file-wrapper"><img
class="confluence-embedded-image"
src="route-throttling-example.data/throttling%20services.png"
data-image-src="/confluence/download/attachments/5604305/throttling%20services.png?version=1&modificationDate=1257166177000&api=v2"
data-unresolved-comment-count="0" data-linked-resource-id="5865480"
data-linked-resource-version="1" data-linked-resource-type="attachment"
data-linked-resource-default-alias="throttling services.png"
data-base-url="https://cwiki.apache.org/confluence"
data-linked-resource-content-type="image/png"
data-linked-resource-container-id="5604305"
data-linked-resource-container-version="31"></span></p>
<p>See more at <a shape="rect" href="camel-jmx.html">using JMX with
Camel</a>.</p>
@@ -160,7 +160,7 @@ For example you can change the option <c
<p>When running the example you should see a lot of activity logged to the
console. <br clear="none">
Below is a snippet when the example runs to an end when the 10000 messages
have been processed. What you should notice is that the throttling ensures that
the JMS consumer is not taking in more messages than we can process. That means
that ++<span style="text-decoration: underline;">JMS</span>++ and ++<span
style="text-decoration: underline;">SEDA</span>++ are completing at nearly the
same time. </p>
-<div class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<div class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">
[ultMessageListenerContainer-42] +++JMS +++ INFO
Received: 9800 messages so far. Last group took: 673 millis which is: 148.588
messages per second. average: 159.734
[currentConsumers=25&size=25000] ThrottlingInflightRoutePolicy WARN
Throttling consumer: 25 > 20 inflight exchange by suspending consumer.
@@ -185,7 +185,7 @@ Below is a snippet when the example runs
<p>However if you run the example <strong>without</strong> the throttling you
will notice that the JMS consumer runs faster than we can process the messages.
Towards the end we have more than 2000 messages pending on the internal SEDA
queue, when the JMS consumer finishes.</p>
-<div class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<div class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">
[ultMessageListenerContainer-41] +++JMS +++ INFO
Received: 9800 messages so far. Last group took: 304 millis which is: 328.947
messages per second. average: 225.272
[currentConsumers=25&size=25000] +++SEDA+++ INFO
Received: 7800 messages so far. Last group took: 645 millis which is: 155.039
messages per second. average: 178.461
Modified: websites/production/camel/content/scatter-gather.html
==============================================================================
--- websites/production/camel/content/scatter-gather.html (original)
+++ websites/production/camel/content/scatter-gather.html Tue Mar 26 22:22:28
2019
@@ -212,7 +212,7 @@ result.expectedBodiesReceived(1); // exp
<p>You can lock down which recipients are used in the Scatter-Gather by using
a static <a shape="rect" href="recipient-list.html">Recipient List</a>. It
looks something like this</p>
-<div class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<div class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">
from("direct:start").multicast().to("seda:vendor1", "seda:vendor2",
"seda:vendor3");
Modified: websites/production/camel/content/servlet-tomcat-example.html
==============================================================================
--- websites/production/camel/content/servlet-tomcat-example.html (original)
+++ websites/production/camel/content/servlet-tomcat-example.html Tue Mar 26
22:22:28 2019
@@ -89,7 +89,7 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2
id="ServletTomcatExample-ServletTomcatExample">Servlet Tomcat
Example</h2><p><strong>Available as of Camel 2.7</strong></p><p>This example is
located in the <code>examples/camel-example-servlet-tomcat</code> directory of
the Camel distribution.<br clear="none"> There is a <code>README.txt</code>
file with instructions how to run it.</p><p>If you use maven then you can
easily package the example from the command line:</p><div class="code panel pdl
conf-macro output-block" data-hasbody="true" data-macro-name="code"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<div class="wiki-content maincontent"><h2
id="ServletTomcatExample-ServletTomcatExample">Servlet Tomcat
Example</h2><p><strong>Available as of Camel 2.7</strong></p><p>This example is
located in the <code>examples/camel-example-servlet-tomcat</code> directory of
the Camel distribution.<br clear="none"> There is a <code>README.txt</code>
file with instructions how to run it.</p><p>If you use maven then you can
easily package the example from the command line:</p><div class="code panel pdl
conf-macro output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">mvn package
</pre>
</div></div><h3 id="ServletTomcatExample-About">About</h3><p>This example
demonstrates how you can use <a shape="rect" href="servlet.html">Servlet</a> to
expose a http service in a Camel route.</p><h3
id="ServletTomcatExample-Implementation">Implementation</h3><p>In the
<code>web.xml</code> file in the <code>src/main/webapp/WEB-INF</code> folder
the CamelServlet is defined. This is mandatory to do when using the <a
shape="rect" href="servlet.html">Servlet</a> component.Error rendering macro
'code': Invalid value specified for parameter
'java.lang.NullPointerException'</p><pre class="conf-macro output-inline"
data-hasbody="true" data-macro-name="unmigrated-inline-wiki-markup">
Modified:
websites/production/camel/content/servlet-tomcat-no-spring-example.html
==============================================================================
--- websites/production/camel/content/servlet-tomcat-no-spring-example.html
(original)
+++ websites/production/camel/content/servlet-tomcat-no-spring-example.html Tue
Mar 26 22:22:28 2019
@@ -89,7 +89,7 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2
id="ServletTomcatNoSpringExample-ServletTomcatNoSpringExample">Servlet Tomcat
No Spring Example</h2><p><strong>Available as of Camel 2.11</strong></p><p>This
example is located in the
<code>examples/camel-example-servlet-tomcat-no-spring</code> directory of the
Camel distribution.<br clear="none"> There is a <code>README.txt</code> file
with instructions how to run it.</p><p>If you use maven then you can easily
package the example from the command line:</p><div class="code panel pdl
conf-macro output-block" data-hasbody="true" data-macro-name="code"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<div class="wiki-content maincontent"><h2
id="ServletTomcatNoSpringExample-ServletTomcatNoSpringExample">Servlet Tomcat
No Spring Example</h2><p><strong>Available as of Camel 2.11</strong></p><p>This
example is located in the
<code>examples/camel-example-servlet-tomcat-no-spring</code> directory of the
Camel distribution.<br clear="none"> There is a <code>README.txt</code> file
with instructions how to run it.</p><p>If you use maven then you can easily
package the example from the command line:</p><div class="code panel pdl
conf-macro output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">mvn package
</pre>
</div></div><h3 id="ServletTomcatNoSpringExample-About">About</h3><p>This
example demonstrates how you can create light-weight web applications without
the need for Spring Framework.<br clear="none"> The example contains a Camel
routes that used the <a shape="rect" href="servlet.html">Servlet</a> component
to expose a http service.</p><h3
id="ServletTomcatNoSpringExample-Implementation">Implementation</h3><p>In the
<code>web.xml</code> file in the <code>src/main/webapp/WEB-INF</code> folder we
have both a CamelServlet and CamelContextListener defined.<br clear="none"> The
CamelServlet is mandatory to do when using the <a shape="rect"
href="servlet.html">Servlet</a> component. And the
<code>JndiCamelServletContextListener</code> is used to bootstrap the Camel
application.</p><div class="error conf-macro output-inline" data-hasbody="true"
data-macro-name="unmigrated-inline-wiki-markup"><span class="error">Error
formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20,
Size: 20</span> </div><div class="confluence-information-macro
confluence-information-macro-tip conf-macro output-block" data-hasbody="true"
data-macro-name="tip"><span class="aui-icon aui-icon-small aui-iconfont-approve
confluence-information-macro-icon"> </span><div
class="confluence-information-macro-body"><p>Its the <a shape="rect"
href="servletlistener-component.html">ServletListener Component</a> that is
used to bootstrap Camel in the web application. See more details at <a
shape="rect" href="servletlistener-component.html">ServletListener
Component</a>.</p></div></div><h4
id="ServletTomcatNoSpringExample-TheCamelroute">The Camel route</h4><p>The
route is a simple <a shape="rect" href="content-based-router.html">Content
Based Router</a> defined in the DSL XML as shown:</p><div class="error
conf-macro output-inline" data-hasbody="true"
data-macro-name="unmigrated-inline-wiki-markup"><span class="error">Error
formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index
: 20, Size: 20</span> </div><h3
id="ServletTomcatNoSpringExample-Runningtheexample">Running the
example</h3><p>This example runs in any web container such as Apache Tomcat.
For example to deploy in Apache Tomcat you will have to package the .war file
and copy it to the <code>webapp</code> folder of Tomcat, which is the hot
deploy folder.</p><p>There is a main page at: <code><a shape="rect"
class="external-link"
href="http://localhost:8080/camel-example-servlet-tomcat-no-spring"
rel="nofollow">http://localhost:8080/camel-example-servlet-tomcat-no-spring</a></code>
which has more instructions.<br clear="none"> You can then use a web browser
and send a request to the <code><a shape="rect" class="external-link"
href="http://localhost:8080/camel-example-servlet-tomcat-no-spring/camel/hello"
rel="nofollow">http://localhost:8080/camel-example-servlet-tomcat-no-spring/camel/hello</a></code>
url.</p><h3 id="ServletTomcatNoSpringExample-SeeAlso">See Also</h3><ul
class="alternate"><li><a shape
="rect" href="examples.html">Examples</a></li><li><a shape="rect"
href="servlet-tomcat-example.html">Servlet Tomcat Example</a></li><li><a
shape="rect" href="servletlistener-component.html">ServletListener
Component</a></li><li><a shape="rect"
href="servlet.html">Servlet</a></li><li><a shape="rect"
href="http.html">HTTP</a></li></ul></div>
Modified: websites/production/camel/content/simple-jira-bot.html
==============================================================================
--- websites/production/camel/content/simple-jira-bot.html (original)
+++ websites/production/camel/content/simple-jira-bot.html Tue Mar 26 22:22:28
2019
@@ -132,7 +132,7 @@ Error rendering macro 'code': Invalid va
<h3 id="SimpleJiraBot-Usage">Usage</h3>
<p>To run the Java DSL example type</p>
-<div class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<div class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">
cd javadsl
mvn camel:run
@@ -140,7 +140,7 @@ mvn camel:run
</div></div>
<p>To run the XML Configuration example type</p>
-<div class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<div class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">
cd xmlconf
mvn camel:run
@@ -148,7 +148,7 @@ mvn camel:run
</div></div>
<p>It takes about 10 second before the bot will join the channel and Camel
logs to the screen the first time. The log should be like this</p>
-<div class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<div class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">
2011-01-03 07:24:43,840 [archRequest.xml] INFO jirabot
- Exchange[Body:[CAMEL-2480] Use mock XMPP server for unit tests]
Modified: websites/production/camel/content/siteindex.html
==============================================================================
--- websites/production/camel/content/siteindex.html (original)
+++ websites/production/camel/content/siteindex.html Tue Mar 26 22:22:28 2019
@@ -92,14 +92,14 @@
<div class="wiki-content maincontent">
<span class="conf-macro output-inline" data-hasbody="true"
data-macro-name="unmigrated-inline-wiki-markup"></span><h2>Space Index</h2>
<div class="index-macro-info">
- <h4>Total number of pages: 960</h4>
+ <h4>Total number of pages: 961</h4>
<span class="excerpt-info">
<span class="aui-icon aui-icon-small aui-iconfont-info">info</span>
Page excerpts are hidden because there are more than 200 pages
</span>
</div>
<table class="grid" width="99%" cellspacing="0"><tbody><tr><td colspan="2"
rowspan="1">
- <table width="100%"><tbody><tr><td colspan="1" rowspan="1"><a
shape="rect" href="#index-0-9">0-9</a> ... 0</td><td colspan="1" rowspan="1"><a
shape="rect" href="#index-A">A</a> ... 39</td><td colspan="1" rowspan="1"><a
shape="rect" href="#index-B">B</a> ... 43</td><td colspan="1" rowspan="1"><a
shape="rect" href="#index-C">C</a> ... 223</td><td colspan="1" rowspan="1"><a
shape="rect" href="#index-D">D</a> ... 32</td><td colspan="1" rowspan="1"><a
shape="rect" href="#index-E">E</a> ... 33</td></tr><tr><td colspan="1"
rowspan="1"><a shape="rect" href="#index-F">F</a> ... 15</td><td colspan="1"
rowspan="1"><a shape="rect" href="#index-G">G</a> ... 33</td><td colspan="1"
rowspan="1"><a shape="rect" href="#index-H">H</a> ... 88</td><td colspan="1"
rowspan="1"><a shape="rect" href="#index-I">I</a> ... 19</td><td colspan="1"
rowspan="1"><a shape="rect" href="#index-J">J</a> ... 32</td><td colspan="1"
rowspan="1"><a shape="rect" href="#index-K">K</a> ... 6</td></tr><tr><td
colspan=
"1" rowspan="1"><a shape="rect" href="#index-L">L</a> ... 20</td><td
colspan="1" rowspan="1"><a shape="rect" href="#index-M">M</a> ... 36</td><td
colspan="1" rowspan="1"><a shape="rect" href="#index-N">N</a> ... 12</td><td
colspan="1" rowspan="1"><a shape="rect" href="#index-O">O</a> ... 7</td><td
colspan="1" rowspan="1"><a shape="rect" href="#index-P">P</a> ... 27</td><td
colspan="1" rowspan="1"><a shape="rect" href="#index-Q">Q</a> ...
5</td></tr><tr><td colspan="1" rowspan="1"><a shape="rect"
href="#index-R">R</a> ... 33</td><td colspan="1" rowspan="1"><a shape="rect"
href="#index-S">S</a> ... 90</td><td colspan="1" rowspan="1"><a shape="rect"
href="#index-T">T</a> ... 44</td><td colspan="1" rowspan="1"><a shape="rect"
href="#index-U">U</a> ... 19</td><td colspan="1" rowspan="1"><a shape="rect"
href="#index-V">V</a> ... 8</td><td colspan="1" rowspan="1"><a shape="rect"
href="#index-W">W</a> ... 30</td></tr><tr><td colspan="1" rowspan="1"><a
shape="rect" href="#index-X">X</a> ...
14</td><td colspan="1" rowspan="1"><a shape="rect" href="#index-Y">Y</a> ...
2</td><td colspan="1" rowspan="1"><a shape="rect" href="#index-Z">Z</a> ...
4</td><td colspan="1" rowspan="1"><a shape="rect"
href="#index-%21@%23%24">!@#$</a> ... 0</td><td colspan="1"
rowspan="1"> </td><td colspan="1"
rowspan="1"> </td></tr></tbody></table>
+ <table width="100%"><tbody><tr><td colspan="1" rowspan="1"><a
shape="rect" href="#index-0-9">0-9</a> ... 0</td><td colspan="1" rowspan="1"><a
shape="rect" href="#index-A">A</a> ... 39</td><td colspan="1" rowspan="1"><a
shape="rect" href="#index-B">B</a> ... 43</td><td colspan="1" rowspan="1"><a
shape="rect" href="#index-C">C</a> ... 224</td><td colspan="1" rowspan="1"><a
shape="rect" href="#index-D">D</a> ... 32</td><td colspan="1" rowspan="1"><a
shape="rect" href="#index-E">E</a> ... 33</td></tr><tr><td colspan="1"
rowspan="1"><a shape="rect" href="#index-F">F</a> ... 15</td><td colspan="1"
rowspan="1"><a shape="rect" href="#index-G">G</a> ... 33</td><td colspan="1"
rowspan="1"><a shape="rect" href="#index-H">H</a> ... 88</td><td colspan="1"
rowspan="1"><a shape="rect" href="#index-I">I</a> ... 19</td><td colspan="1"
rowspan="1"><a shape="rect" href="#index-J">J</a> ... 32</td><td colspan="1"
rowspan="1"><a shape="rect" href="#index-K">K</a> ... 6</td></tr><tr><td
colspan=
"1" rowspan="1"><a shape="rect" href="#index-L">L</a> ... 20</td><td
colspan="1" rowspan="1"><a shape="rect" href="#index-M">M</a> ... 36</td><td
colspan="1" rowspan="1"><a shape="rect" href="#index-N">N</a> ... 12</td><td
colspan="1" rowspan="1"><a shape="rect" href="#index-O">O</a> ... 7</td><td
colspan="1" rowspan="1"><a shape="rect" href="#index-P">P</a> ... 27</td><td
colspan="1" rowspan="1"><a shape="rect" href="#index-Q">Q</a> ...
5</td></tr><tr><td colspan="1" rowspan="1"><a shape="rect"
href="#index-R">R</a> ... 33</td><td colspan="1" rowspan="1"><a shape="rect"
href="#index-S">S</a> ... 90</td><td colspan="1" rowspan="1"><a shape="rect"
href="#index-T">T</a> ... 44</td><td colspan="1" rowspan="1"><a shape="rect"
href="#index-U">U</a> ... 19</td><td colspan="1" rowspan="1"><a shape="rect"
href="#index-V">V</a> ... 8</td><td colspan="1" rowspan="1"><a shape="rect"
href="#index-W">W</a> ... 30</td></tr><tr><td colspan="1" rowspan="1"><a
shape="rect" href="#index-X">X</a> ...
14</td><td colspan="1" rowspan="1"><a shape="rect" href="#index-Y">Y</a> ...
2</td><td colspan="1" rowspan="1"><a shape="rect" href="#index-Z">Z</a> ...
4</td><td colspan="1" rowspan="1"><a shape="rect"
href="#index-%21@%23%24">!@#$</a> ... 0</td><td colspan="1"
rowspan="1"> </td><td colspan="1"
rowspan="1"> </td></tr></tbody></table>
</td></tr><tr valign="top"><td colspan="1" rowspan="1"><h4
style="margin-top: 0px"><a shape="rect" name="index-0-9"></a>0-9</h4>
</td><td colspan="1" rowspan="1"><h4 style="margin-top: 0px"><a
shape="rect" name="index-A"></a>A</h4>
<span class="icon aui-icon content-type-page"
title="Page">Page:</span> <a shape="rect"
href="acknowledgment.html">Acknowledgment</a>
@@ -542,6 +542,8 @@
<br clear="none">
<span class="icon aui-icon
content-type-page" title="Page">Page:</span> <a shape="rect"
href="camel-30-roadmap.html">Camel 3.0 - Roadmap</a>
<br clear="none">
+ <span class="icon aui-icon
content-type-page" title="Page">Page:</span> <a shape="rect"
href="camel-300-m1-milestone-1-release.html">Camel 3.0.0-M1 (Milestone 1)
Release</a>
+ <br clear="none">
<span class="icon aui-icon
content-type-page" title="Page">Page:</span> <a shape="rect"
href="camel-apachecon.html">Camel @ ApacheCon</a>
<br clear="none">
<span class="icon aui-icon
content-type-page" title="Page">Page:</span> <a shape="rect"
href="camel-and-scr.html">Camel and SCR</a>
Modified: websites/production/camel/content/spring-remoting.html
==============================================================================
--- websites/production/camel/content/spring-remoting.html (original)
+++ websites/production/camel/content/spring-remoting.html Tue Mar 26 22:22:28
2019
@@ -159,35 +159,35 @@ Error rendering macro 'code': Invalid va
<p>For more details see <a shape="rect"
href="using-exchange-pattern-annotations.html">Using Exchange Pattern
Annotations</a></p>
-<div class="conf-macro output-block" data-hasbody="false"
data-macro-name="include"><h2 id="SpringRemoting-BeanBinding">Bean
Binding</h2><p>Bean Binding in Camel defines both which methods are invoked and
also how the <a shape="rect" href="message.html">Message</a> is converted into
the parameters of the method when it is invoked.</p><h3
id="SpringRemoting-Choosingthemethodtoinvoke">Choosing the method to
invoke</h3><p>The binding of a Camel <a shape="rect"
href="message.html">Message</a> to a bean method call can occur in different
ways, in the following order of importance:</p><ul><li>if the message contains
the header <strong>CamelBeanMethodName</strong> then that method is invoked,
converting the body to the type of the method's argument.<ul><li>From
<strong>Camel 2.8</strong> onwards you can qualify parameter types to select
exactly which method to use among overloads with the same name (see below for
more details).</li><li>From <strong>Camel 2.9</strong> onwards you can specif
y parameter values directly in the method option (see below for more
details).</li></ul></li><li>you can explicitly specify the method name in the
<a shape="rect" href="dsl.html">DSL</a> or when using <a shape="rect"
href="pojo-consuming.html">POJO Consuming</a> or <a shape="rect"
href="pojo-producing.html">POJO Producing</a></li><li>if the bean has a method
marked with the <code>@Handler</code> annotation, then that method is
selected</li><li>if the bean can be converted to a <a shape="rect"
href="processor.html">Processor</a> using the <a shape="rect"
href="type-converter.html">Type Converter</a> mechanism, then this is used to
process the message. The <a shape="rect" href="activemq.html">ActiveMQ</a>
component uses this mechanism to allow any JMS MessageListener to be invoked
directly by Camel without having to write any integration glue code. You can
use the same mechanism to integrate Camel into any other messaging/remoting
frameworks.</li><li>if the body of the message can be
converted to a <a shape="rect" class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/component/bean/BeanInvocation.html">BeanInvocation</a>
(the default payload used by the <a shape="rect" class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/component/bean/ProxyHelper.html">ProxyHelper</a>)
component - then that is used to invoke the method and pass its
arguments</li><li>otherwise the type of the body is used to find a matching
method; an error is thrown if a single method cannot be chosen
unambiguously.</li><li>you can also use Exchange as the parameter itself, but
then the return type must be void.</li><li>if the bean class is private (or
package-private), interface methods will be preferred (from <strong>Camel
2.9</strong> onwards) since Camel can't invoke class methods on such
beans</li></ul><p>In cases where Camel cannot choose a method to invoke, an
<code>AmbiguousMethodCallExcepti
on</code> is thrown.</p><p>By default the return value is set on the outbound
message body. </p><h3
id="SpringRemoting-Asynchronousprocessing">Asynchronous
processing</h3><p>From <strong>Camel 2.18</strong> onwards you can
return a CompletionStage implementation (e.g. a CompletableFuture) to implement
asynchronous processing.</p><p>Please be sure to properly complete the
CompletionStage with the result or exception, including any timeout handling.
Exchange processing would wait for completion and would not impose any timeouts
automatically. It's extremely useful to monitor <a shape="rect"
class="external-link"
href="https://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/InflightRepository.html">Inflight
repository</a> for any hanging messages.</p><p>Note that completing with
"null" won't set outbody message body to null, but would keep message intact.
This is useful to support methods that don't modify exchange and return
CompletableFuture
<Void>. To set body to null, just add Exchange method parameter and
directly modify exchange messages.</p><p>Examples:</p><p>Simple asynchronous
processor, modifying message body.</p><div class="code panel pdl conf-macro
output-block" data-hasbody="true" data-macro-name="code" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+<div class="conf-macro output-block" data-hasbody="false"
data-macro-name="include"><h2 id="SpringRemoting-BeanBinding">Bean
Binding</h2><p>Bean Binding in Camel defines both which methods are invoked and
also how the <a shape="rect" href="message.html">Message</a> is converted into
the parameters of the method when it is invoked.</p><h3
id="SpringRemoting-Choosingthemethodtoinvoke">Choosing the method to
invoke</h3><p>The binding of a Camel <a shape="rect"
href="message.html">Message</a> to a bean method call can occur in different
ways, in the following order of importance:</p><ul><li>if the message contains
the header <strong>CamelBeanMethodName</strong> then that method is invoked,
converting the body to the type of the method's argument.<ul><li>From
<strong>Camel 2.8</strong> onwards you can qualify parameter types to select
exactly which method to use among overloads with the same name (see below for
more details).</li><li>From <strong>Camel 2.9</strong> onwards you can specif
y parameter values directly in the method option (see below for more
details).</li></ul></li><li>you can explicitly specify the method name in the
<a shape="rect" href="dsl.html">DSL</a> or when using <a shape="rect"
href="pojo-consuming.html">POJO Consuming</a> or <a shape="rect"
href="pojo-producing.html">POJO Producing</a></li><li>if the bean has a method
marked with the <code>@Handler</code> annotation, then that method is
selected</li><li>if the bean can be converted to a <a shape="rect"
href="processor.html">Processor</a> using the <a shape="rect"
href="type-converter.html">Type Converter</a> mechanism, then this is used to
process the message. The <a shape="rect" href="activemq.html">ActiveMQ</a>
component uses this mechanism to allow any JMS MessageListener to be invoked
directly by Camel without having to write any integration glue code. You can
use the same mechanism to integrate Camel into any other messaging/remoting
frameworks.</li><li>if the body of the message can be
converted to a <a shape="rect" class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/component/bean/BeanInvocation.html">BeanInvocation</a>
(the default payload used by the <a shape="rect" class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/component/bean/ProxyHelper.html">ProxyHelper</a>)
component - then that is used to invoke the method and pass its
arguments</li><li>otherwise the type of the body is used to find a matching
method; an error is thrown if a single method cannot be chosen
unambiguously.</li><li>you can also use Exchange as the parameter itself, but
then the return type must be void.</li><li>if the bean class is private (or
package-private), interface methods will be preferred (from <strong>Camel
2.9</strong> onwards) since Camel can't invoke class methods on such
beans</li></ul><p>In cases where Camel cannot choose a method to invoke, an
<code>AmbiguousMethodCallExcepti
on</code> is thrown.</p><p>By default the return value is set on the outbound
message body. </p><h3
id="SpringRemoting-Asynchronousprocessing">Asynchronous
processing</h3><p>From <strong>Camel 2.18</strong> onwards you can
return a CompletionStage implementation (e.g. a CompletableFuture) to implement
asynchronous processing.</p><p>Please be sure to properly complete the
CompletionStage with the result or exception, including any timeout handling.
Exchange processing would wait for completion and would not impose any timeouts
automatically. It's extremely useful to monitor <a shape="rect"
class="external-link"
href="https://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/InflightRepository.html">Inflight
repository</a> for any hanging messages.</p><p>Note that completing with
"null" won't set outbody message body to null, but would keep message intact.
This is useful to support methods that don't modify exchange and return
CompletableFuture
<Void>. To set body to null, just add Exchange method parameter and
directly modify exchange messages.</p><p>Examples:</p><p>Simple asynchronous
processor, modifying message body.</p><div class="code panel pdl conf-macro
output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">public
CompletableFuture<String> doSomethingAsync(String body)</pre>
-</div></div><p><br clear="none">Composite processor that do not modify
exchange</p><div class="code panel pdl conf-macro output-block"
data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+</div></div><p><br clear="none">Composite processor that do not modify
exchange</p><div class="code panel pdl conf-macro output-block"
style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div
class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default"> public
CompletableFuture<Void> doSomethingAsync(String body) {
return CompletableFuture.allOf(doA(body), doB(body), doC());
}</pre>
-</div></div><h3 id="SpringRemoting-Parameterbinding"><br
clear="none">Parameter binding</h3><p>When a method has been chosen for
invocation, Camel will bind to the parameters of the method.</p><p>The
following Camel-specific types are automatically bound:</p><ul
class="alternate"><li><code>org.apache.camel.Exchange</code></li><li><code>org.apache.camel.Message</code></li><li><code>org.apache.camel.CamelContext</code></li><li><code>org.apache.camel.TypeConverter</code></li><li><code>org.apache.camel.spi.Registry</code></li><li><code>java.lang.Exception</code></li></ul><p>So,
if you declare any of these types, they will be provided by Camel.
<strong>Note that <code>Exception</code> will bind to the caught exception of
the <a shape="rect" href="exchange.html">Exchange</a></strong> - so it's often
usable if you employ a <a shape="rect" href="pojo.html">Pojo</a> to handle,
e.g., an <code>onException</code> route.</p><p>What is most interesting is that
Camel will also try to bind the body
of the <a shape="rect" href="exchange.html">Exchange</a> to the first
parameter of the method signature (albeit not of any of the types above). So
if, for instance, we declare a parameter as <code>String body</code>, then
Camel will bind the IN body to this type. Camel will also automatically convert
to the type declared in the method signature.</p><p>Let's review some
examples:</p><p>Below is a simple method with a body binding. Camel will bind
the IN body to the <code>body</code> parameter and convert it to a
<code>String</code>.</p><div class="code panel pdl conf-macro output-block"
data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+</div></div><h3 id="SpringRemoting-Parameterbinding"><br
clear="none">Parameter binding</h3><p>When a method has been chosen for
invocation, Camel will bind to the parameters of the method.</p><p>The
following Camel-specific types are automatically bound:</p><ul
class="alternate"><li><code>org.apache.camel.Exchange</code></li><li><code>org.apache.camel.Message</code></li><li><code>org.apache.camel.CamelContext</code></li><li><code>org.apache.camel.TypeConverter</code></li><li><code>org.apache.camel.spi.Registry</code></li><li><code>java.lang.Exception</code></li></ul><p>So,
if you declare any of these types, they will be provided by Camel.
<strong>Note that <code>Exception</code> will bind to the caught exception of
the <a shape="rect" href="exchange.html">Exchange</a></strong> - so it's often
usable if you employ a <a shape="rect" href="pojo.html">Pojo</a> to handle,
e.g., an <code>onException</code> route.</p><p>What is most interesting is that
Camel will also try to bind the body
of the <a shape="rect" href="exchange.html">Exchange</a> to the first
parameter of the method signature (albeit not of any of the types above). So
if, for instance, we declare a parameter as <code>String body</code>, then
Camel will bind the IN body to this type. Camel will also automatically convert
to the type declared in the method signature.</p><p>Let's review some
examples:</p><p>Below is a simple method with a body binding. Camel will bind
the IN body to the <code>body</code> parameter and convert it to a
<code>String</code>.</p><div class="code panel pdl conf-macro output-block"
style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div
class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">public String
doSomething(String body)</pre>
-</div></div><p>In the following sample we got one of the automatically-bound
types as well - for instance, a <code>Registry</code> that we can use to lookup
beans.</p><div class="code panel pdl conf-macro output-block"
data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+</div></div><p>In the following sample we got one of the automatically-bound
types as well - for instance, a <code>Registry</code> that we can use to lookup
beans.</p><div class="code panel pdl conf-macro output-block"
style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div
class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">public String
doSomething(String body, Registry registry) </pre>
-</div></div><p><br clear="none">We can use <a shape="rect"
href="exchange.html">Exchange</a> as well:</p><div class="code panel pdl
conf-macro output-block" data-hasbody="true" data-macro-name="code"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p><br clear="none">We can use <a shape="rect"
href="exchange.html">Exchange</a> as well:</p><div class="code panel pdl
conf-macro output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">public String
doSomething(String body, Exchange exchange) </pre>
-</div></div><p><br clear="none">You can also have multiple types:</p><div
class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><p><br clear="none">You can also have multiple types:</p><div
class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">public String
doSomething(String body, Exchange exchange, TypeConverter converter) </pre>
-</div></div><p><br clear="none">And imagine you use a <a shape="rect"
href="pojo.html">Pojo</a> to handle a given custom exception
<code>InvalidOrderException</code> - we can then bind that as well:</p><div
class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><p><br clear="none">And imagine you use a <a shape="rect"
href="pojo.html">Pojo</a> to handle a given custom exception
<code>InvalidOrderException</code> - we can then bind that as well:</p><div
class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">public String
badOrder(String body, InvalidOrderException invalid) </pre>
-</div></div><p><br clear="none">Notice that we can bind to it even if we use a
sub type of <code>java.lang.Exception</code> as Camel still knows it's an
exception and can bind the cause (if any exists).</p><p>So what about headers
and other stuff? Well now it gets a bit tricky - so we can use annotations to
help us, or specify the binding in the method name option.<br clear="none"> See
the following sections for more detail.</p><h3
id="SpringRemoting-BindingAnnotations">Binding Annotations</h3><p>You can use
the <a shape="rect" href="parameter-binding-annotations.html">Parameter Binding
Annotations</a> to customize how parameter values are created from the <a
shape="rect" href="message.html">Message</a></p><h4
id="SpringRemoting-Examples">Examples</h4><p>For example, a <a shape="rect"
href="bean.html">Bean</a> such as:</p><div class="code panel pdl conf-macro
output-block" data-hasbody="true" data-macro-name="code" style="border-width:
1px;"><div class="codeContent panelContent pdl"
>
+</div></div><p><br clear="none">Notice that we can bind to it even if we use a
sub type of <code>java.lang.Exception</code> as Camel still knows it's an
exception and can bind the cause (if any exists).</p><p>So what about headers
and other stuff? Well now it gets a bit tricky - so we can use annotations to
help us, or specify the binding in the method name option.<br clear="none"> See
the following sections for more detail.</p><h3
id="SpringRemoting-BindingAnnotations">Binding Annotations</h3><p>You can use
the <a shape="rect" href="parameter-binding-annotations.html">Parameter Binding
Annotations</a> to customize how parameter values are created from the <a
shape="rect" href="message.html">Message</a></p><h4
id="SpringRemoting-Examples">Examples</h4><p>For example, a <a shape="rect"
href="bean.html">Bean</a> such as:</p><div class="code panel pdl conf-macro
output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl"
>
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">public class Bar {
public String doSomething(String body) {
// process the in body and return whatever you want
return "Bye World";
} </pre>
-</div></div><p>Or the Exchange example. Notice that the return type must be
<strong>void</strong> when there is only a single parameter of the type
<code>org.apache.camel.Exchange</code>:</p><div class="code panel pdl
conf-macro output-block" data-hasbody="true" data-macro-name="code"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Or the Exchange example. Notice that the return type must be
<strong>void</strong> when there is only a single parameter of the type
<code>org.apache.camel.Exchange</code>:</p><div class="code panel pdl
conf-macro output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default"> public class Bar {
public void doSomething(Exchange exchange) {
// process the exchange
exchange.getIn().setBody("Bye World");
}</pre>
-</div></div><h4 id="SpringRemoting-@Handler"><br
clear="none">@Handler</h4><p>You can mark a method in your bean with the
@Handler annotation to indicate that this method should be used for <a
shape="rect" href="bean-binding.html">Bean Binding</a>.<br clear="none"> This
has an advantage as you need not specify a method name in the Camel route, and
therefore do not run into problems after renaming the method in an IDE that
can't find all its references.</p><div class="code panel pdl conf-macro
output-block" data-hasbody="true" data-macro-name="code" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+</div></div><h4 id="SpringRemoting-@Handler"><br
clear="none">@Handler</h4><p>You can mark a method in your bean with the
@Handler annotation to indicate that this method should be used for <a
shape="rect" href="bean-binding.html">Bean Binding</a>.<br clear="none"> This
has an advantage as you need not specify a method name in the Camel route, and
therefore do not run into problems after renaming the method in an IDE that
can't find all its references.</p><div class="code panel pdl conf-macro
output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">public class Bar {
@Handler
public String doSomething(String body) {
@@ -195,43 +195,43 @@ Error rendering macro 'code': Invalid va
return "Bye World";
}
} </pre>
-</div></div><h3 id="SpringRemoting-Parameterbindingusingmethodoption"><br
clear="none">Parameter binding using method option</h3><p><strong>Available as
of Camel 2.9</strong></p><p>Camel uses the following rules to determine if it's
a parameter value in the method option</p><ul class="alternate"><li>The value
is either <code>true</code> or <code>false</code> which denotes a boolean
value</li><li>The value is a numeric value such as <code>123</code> or
<code>7</code></li><li>The value is a String enclosed with either single or
double quotes</li><li>The value is null which denotes a <code>null</code>
value</li><li>It can be evaluated using the <a shape="rect"
href="simple.html">Simple</a> language, which means you can use, e.g., body,
header.foo and other <a shape="rect" href="simple.html">Simple</a> tokens.
Notice the tokens must be enclosed with ${ }.</li></ul><p>Any other value is
consider to be a type declaration instead - see the next section about
specifying types for overloaded
methods.</p><p>When invoking a <a shape="rect" href="bean.html">Bean</a> you
can instruct Camel to invoke a specific method by providing the method
name:</p><div class="code panel pdl conf-macro output-block"
data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+</div></div><h3 id="SpringRemoting-Parameterbindingusingmethodoption"><br
clear="none">Parameter binding using method option</h3><p><strong>Available as
of Camel 2.9</strong></p><p>Camel uses the following rules to determine if it's
a parameter value in the method option</p><ul class="alternate"><li>The value
is either <code>true</code> or <code>false</code> which denotes a boolean
value</li><li>The value is a numeric value such as <code>123</code> or
<code>7</code></li><li>The value is a String enclosed with either single or
double quotes</li><li>The value is null which denotes a <code>null</code>
value</li><li>It can be evaluated using the <a shape="rect"
href="simple.html">Simple</a> language, which means you can use, e.g., body,
header.foo and other <a shape="rect" href="simple.html">Simple</a> tokens.
Notice the tokens must be enclosed with ${ }.</li></ul><p>Any other value is
consider to be a type declaration instead - see the next section about
specifying types for overloaded
methods.</p><p>When invoking a <a shape="rect" href="bean.html">Bean</a> you
can instruct Camel to invoke a specific method by providing the method
name:</p><div class="code panel pdl conf-macro output-block"
style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div
class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">.bean(OrderService.class,
"doSomething")</pre>
-</div></div><p> </p><p>Here we tell Camel to invoke the doSomething
method - Camel handles the parameters' binding. Now suppose the method has 2
parameters, and the 2nd parameter is a boolean where we want to pass in a true
value:</p><div class="code panel pdl conf-macro output-block"
data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+</div></div><p> </p><p>Here we tell Camel to invoke the doSomething
method - Camel handles the parameters' binding. Now suppose the method has 2
parameters, and the 2nd parameter is a boolean where we want to pass in a true
value:</p><div class="code panel pdl conf-macro output-block"
style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div
class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">public void
doSomething(String payload, boolean highPriority) {
...
}</pre>
-</div></div><p> </p><p>This is now possible in <strong>Camel 2.9</strong>
onwards:</p><div class="code panel pdl conf-macro output-block"
data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+</div></div><p> </p><p>This is now possible in <strong>Camel 2.9</strong>
onwards:</p><div class="code panel pdl conf-macro output-block"
style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div
class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">.bean(OrderService.class,
"doSomething(*, true)") </pre>
-</div></div><p><br clear="none">In the example above, we defined the first
parameter using the wild card symbol *, which tells Camel to bind this
parameter to any type, and let Camel figure this out. The 2nd parameter has a
fixed value of <code>true</code>. Instead of the wildcard symbol we can
instruct Camel to use the message body as shown:</p><div class="code panel pdl
conf-macro output-block" data-hasbody="true" data-macro-name="code"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p><br clear="none">In the example above, we defined the first
parameter using the wild card symbol *, which tells Camel to bind this
parameter to any type, and let Camel figure this out. The 2nd parameter has a
fixed value of <code>true</code>. Instead of the wildcard symbol we can
instruct Camel to use the message body as shown:</p><div class="code panel pdl
conf-macro output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">.bean(OrderService.class,
"doSomething(${body}, true)") </pre>
-</div></div><p> </p><p>The syntax of the parameters is using the <a
shape="rect" href="simple.html">Simple</a> expression language so we have to
use ${ } placeholders in the body to refer to the message body.</p><p>If you
want to pass in a <code>null</code> value, then you can explicit define this in
the method option as shown below:</p><div class="code panel pdl conf-macro
output-block" data-hasbody="true" data-macro-name="code" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+</div></div><p> </p><p>The syntax of the parameters is using the <a
shape="rect" href="simple.html">Simple</a> expression language so we have to
use ${ } placeholders in the body to refer to the message body.</p><p>If you
want to pass in a <code>null</code> value, then you can explicit define this in
the method option as shown below:</p><div class="code panel pdl conf-macro
output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default"
data-theme="Default">.to("bean:orderService?method=doSomething(null,
true)")</pre>
-</div></div><p><br clear="none">Specifying <code>null</code> as a parameter
value instructs Camel to force passing a <code>null</code> value.</p><p>Besides
the message body, you can pass in the message headers as a
<code>java.util.Map</code>:</p><div class="code panel pdl conf-macro
output-block" data-hasbody="true" data-macro-name="code" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+</div></div><p><br clear="none">Specifying <code>null</code> as a parameter
value instructs Camel to force passing a <code>null</code> value.</p><p>Besides
the message body, you can pass in the message headers as a
<code>java.util.Map</code>:</p><div class="code panel pdl conf-macro
output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">.bean(OrderService.class,
"doSomethingWithHeaders(${body}, ${headers})") </pre>
-</div></div><p>You can also pass in other fixed values besides booleans. For
example, you can pass in a String and an integer:</p><div class="code panel pdl
conf-macro output-block" data-hasbody="true" data-macro-name="code"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>You can also pass in other fixed values besides booleans. For
example, you can pass in a String and an integer:</p><div class="code panel pdl
conf-macro output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">.bean(MyBean.class,
"echo('World', 5)") </pre>
-</div></div><p><br clear="none">In the example above, we invoke the echo
method with two parameters. The first has the content 'World' (without quotes),
and the 2nd has the value of 5.<br clear="none"> Camel will automatically
convert these values to the parameters' types.</p><p>Having the power of the <a
shape="rect" href="simple.html">Simple</a> language allows us to bind to
message headers and other values such as:</p><div class="code panel pdl
conf-macro output-block" data-hasbody="true" data-macro-name="code"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p><br clear="none">In the example above, we invoke the echo
method with two parameters. The first has the content 'World' (without quotes),
and the 2nd has the value of 5.<br clear="none"> Camel will automatically
convert these values to the parameters' types.</p><p>Having the power of the <a
shape="rect" href="simple.html">Simple</a> language allows us to bind to
message headers and other values such as:</p><div class="code panel pdl
conf-macro output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">.bean(OrderService.class,
"doSomething(${body}, ${header.high})") </pre>
-</div></div><p>You can also use the OGNL support of the <a shape="rect"
href="simple.html">Simple</a> expression language. Now suppose the message body
is an object which has a method named <code>asXml</code>. To invoke the
<code>asXml</code> method we can do as follows:</p><div class="code panel pdl
conf-macro output-block" data-hasbody="true" data-macro-name="code"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>You can also use the OGNL support of the <a shape="rect"
href="simple.html">Simple</a> expression language. Now suppose the message body
is an object which has a method named <code>asXml</code>. To invoke the
<code>asXml</code> method we can do as follows:</p><div class="code panel pdl
conf-macro output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">.bean(OrderService.class,
"doSomething(${body.asXml}, ${header.high})") </pre>
-</div></div><p>Instead of using <code>.bean</code> as shown in the examples
above, you may want to use <code>.to</code> instead as shown:</p><div
class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><p>Instead of using <code>.bean</code> as shown in the examples
above, you may want to use <code>.to</code> instead as shown:</p><div
class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default"
data-theme="Default">.to("bean:orderService?method=doSomething(${body.asXml},
${header.high})") </pre>
-</div></div><h3
id="SpringRemoting-Usingtypequalifierstoselectamongoverloadedmethods"><br
clear="none">Using type qualifiers to select among overloaded
methods</h3><p><strong>Available as of Camel 2.8</strong></p><p>If you have a
<a shape="rect" href="bean.html">Bean</a> with overloaded methods, you can now
specify parameter types in the method name so Camel can match the method you
intend to use.<br clear="none"> Given the following bean:</p><div class="code
panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3
id="SpringRemoting-Usingtypequalifierstoselectamongoverloadedmethods"><br
clear="none">Using type qualifiers to select among overloaded
methods</h3><p><strong>Available as of Camel 2.8</strong></p><p>If you have a
<a shape="rect" href="bean.html">Bean</a> with overloaded methods, you can now
specify parameter types in the method name so Camel can match the method you
intend to use.<br clear="none"> Given the following bean:</p><div class="code
panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default"> from("direct:start")
.bean(MyBean.class, "hello(String)")
.to("mock:result");</pre>
-</div></div><p>Then the <code>MyBean</code> has 2 overloaded methods with the
names <code>hello</code> and <code>times</code>. So if we want to use the
method which has 2 parameters we can do as follows in the Camel route:</p><div
class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><p>Then the <code>MyBean</code> has 2 overloaded methods with the
names <code>hello</code> and <code>times</code>. So if we want to use the
method which has 2 parameters we can do as follows in the Camel route:</p><div
class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">from("direct:start")
.bean(MyBean.class, "hello(String,String)")
.to("mock:result"); </pre>
-</div></div><p>We can also use a <code>*</code> as wildcard so we can just say
we want to execute the method with 2 parameters we do</p><div class="code panel
pdl conf-macro output-block" data-hasbody="true" data-macro-name="code"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>We can also use a <code>*</code> as wildcard so we can just say
we want to execute the method with 2 parameters we do</p><div class="code panel
pdl conf-macro output-block" style="border-width: 1px;" data-hasbody="true"
data-macro-name="code"><div class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default"> from("direct:start")
.bean(MyBean.class, "hello(*,*)")
.to("mock:result");</pre>
-</div></div><p>By default Camel will match the type name using the simple
name, e.g. any leading package name will be disregarded. However if you want to
match using the FQN, then specify the FQN type and Camel will leverage that. So
if you have a <code>com.foo.MyOrder</code> and you want to match against the
FQN, and <strong>not</strong> the simple name "MyOrder", then follow this
example:</p><div class="code panel pdl conf-macro output-block"
data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+</div></div><p>By default Camel will match the type name using the simple
name, e.g. any leading package name will be disregarded. However if you want to
match using the FQN, then specify the FQN type and Camel will leverage that. So
if you have a <code>com.foo.MyOrder</code> and you want to match against the
FQN, and <strong>not</strong> the simple name "MyOrder", then follow this
example:</p><div class="code panel pdl conf-macro output-block"
style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div
class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">.bean(OrderService.class,
"doSomething(com.foo.MyOrder)")</pre>
-</div></div><p><br clear="none">Camel currently only supports either
specifying parameter binding or type per parameter in the method name option.
You <strong>cannot</strong> specify both at the same time, such as</p><div
class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><p><br clear="none">Camel currently only supports either
specifying parameter binding or type per parameter in the method name option.
You <strong>cannot</strong> specify both at the same time, such as</p><div
class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default"
data-theme="Default"> doSomething(com.foo.MyOrder ${body}, boolean
${header.high})</pre>
</div></div><p>This may change in the future.</p></div></div>
</td>
Modified: websites/production/camel/content/spring-security-example.html
==============================================================================
--- websites/production/camel/content/spring-security-example.html (original)
+++ websites/production/camel/content/spring-security-example.html Tue Mar 26
22:22:28 2019
@@ -89,15 +89,15 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2
id="SpringSecurityExample-SpringSecurityExample">Spring Security
Example</h2><p>The <a shape="rect"
href="spring-security.html">camel-spring-security</a> module provides
authentication and authorization capabilities via <a shape="rect"
class="external-link"
href="http://static.springsource.org/spring-security/site/index.html"
rel="nofollow">Spring Security</a>. This example shows you how to use this
functionality to implement a role based authorization application.</p><p>This
example consumes messages from a servlet endpoint which is secured by Spring
Security with http basic authentication, there are two services:</p><div
class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+<div class="wiki-content maincontent"><h2
id="SpringSecurityExample-SpringSecurityExample">Spring Security
Example</h2><p>The <a shape="rect"
href="spring-security.html">camel-spring-security</a> module provides
authentication and authorization capabilities via <a shape="rect"
class="external-link"
href="http://static.springsource.org/spring-security/site/index.html"
rel="nofollow">Spring Security</a>. This example shows you how to use this
functionality to implement a role based authorization application.</p><p>This
example consumes messages from a servlet endpoint which is secured by Spring
Security with http basic authentication, there are two services:</p><div
class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default">
"http://localhost:8080/camel/user" is for the authenticated user whose role is
ROLE_USER
"http://localhost:8080/camel/admin" is for the authenticated user whose role
is ROLE_ADMIN
</pre>
-</div></div><p>You will need to compile this example first:</p><div
class="code panel pdl conf-macro output-block" data-hasbody="true"
data-macro-name="code" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
+</div></div><p>You will need to compile this example first:</p><div
class="code panel pdl conf-macro output-block" style="border-width: 1px;"
data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent
pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default"> cd
$CAMEL_HOME/examples/camel-example-spring-security
mvn clean install
</pre>
-</div></div><p>To run the example, you need to start up the server by
typing</p><div class="code panel pdl conf-macro output-block"
data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+</div></div><p>To run the example, you need to start up the server by
typing</p><div class="code panel pdl conf-macro output-block"
style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div
class="codeContent panelContent pdl">
<pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java;
gutter: false; theme: Default" data-theme="Default"> mvn jetty:run
</pre>
</div></div><p>To stop the server hit ctrl + c</p><p>Then you can use the
script in the client directory to send the request and check the response, or
use browser to access upper service with the user/password ("jim/jimspassword"
with the admin and user role or "rob/robspassword" with user role).</p><p>Here
is the camel route configuration:</p>Error rendering macro 'code': Invalid
value specified for parameter 'java.lang.NullPointerException'<pre
class="conf-macro output-inline" data-hasbody="true"
data-macro-name="unmigrated-inline-wiki-markup">