Modified: websites/production/camel/content/book-component-appendix.html
==============================================================================
--- websites/production/camel/content/book-component-appendix.html (original)
+++ websites/production/camel/content/book-component-appendix.html Fri Aug 25 
08:22:01 2017
@@ -39,7 +39,6 @@
   <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/shBrushSql.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>
@@ -87,95 +86,70 @@
        <tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><div class="chapter" 
id="chapter-component-appendix"><h1 
id="BookComponentAppendix-ComponentAppendix">Component Appendix</h1><p>There 
now follows the documentation on each Camel component.</p><h2 
id="BookComponentAppendix-ActiveMQComponent">ActiveMQ Component</h2><p>The 
ActiveMQ component allows messages to be sent to a <a shape="rect" 
class="external-link" href="http://java.sun.com/products/jms/"; 
rel="nofollow">JMS</a> Queue or Topic or messages to be consumed from a JMS 
Queue or Topic using <a shape="rect" class="external-link" 
href="http://activemq.apache.org/"; title="The most popular and powerful open 
source message broker">Apache ActiveMQ</a>. This component is based on <a 
shape="rect" href="jms.html">JMS Component</a> and uses Spring's JMS support 
for declarative transactions, using Spring's 
<strong><code>JmsTemplate</code></strong> for sending and a 
<strong><code>MessageListenerContainer</code></strong> for consuming. All the 
options from
  the <a shape="rect" href="jms.html">JMS</a> component also applies for this 
component.</p><p>To use this component make sure you have the 
<strong><code>activemq.jar</code></strong> or 
<strong><code>activemq-core.jar</code></strong> on your classpath along with 
any Camel dependencies such as <strong><code>camel-core.jar</code></strong>, 
<strong><code>camel-spring.jar</code></strong> and 
<strong><code>camel-jms.jar</code></strong>.</p><div 
class="confluence-information-macro confluence-information-macro-tip"><p 
class="title">Transacted and caching</p><span class="aui-icon aui-icon-small 
aui-iconfont-approve confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>See section <em>Transactions and 
Cache Levels</em> below on <a shape="rect" href="jms.html">JMS</a> page if you 
are using transactions with <a shape="rect" href="jms.html">JMS</a> as it can 
impact performance.</p></div></div><h3 id="BookComponentAppendix-URIformat">URI 
format</h3><div class
 ="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[activemq:[queue:|topic:]destinationName
-]]></script>
-</div></div><p>Where&#160;<strong><code>destinationName</code></strong> is an 
ActiveMQ queue or topic name. By default, 
the&#160;<strong><code>destinationName</code></strong> is interpreted as a 
queue name. For example, to connect to the queue, 
<strong><code>FOO.BAR</code></strong>, use:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[activemq:FOO.BAR
-]]></script>
-</div></div><p>You can include the optional 
<strong><code>queue:</code></strong> prefix, if you prefer:</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[activemq:queue:FOO.BAR
-]]></script>
-</div></div><p>To connect to a topic, you must include the 
<strong><code>topic:</code></strong> prefix. For example, to connect to the 
topic, <strong><code>Stocks.Prices</code></strong>, use:</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[activemq:topic:Stocks.Prices
-]]></script>
-</div></div><h3 id="BookComponentAppendix-Options">Options</h3><p>See Options 
on the <a shape="rect" href="jms.html">JMS</a> component as all these options 
also apply for this component.</p><h3 
id="BookComponentAppendix-ConfiguringtheConnectionFactory">Configuring the 
Connection Factory</h3><p>This <a shape="rect" class="external-link" 
href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQRouteTest.java";>test
 case</a> shows how to add 
an&#160;<strong><code>ActiveMQComponent</code></strong> to the <a shape="rect" 
href="camelcontext.html">CamelContext</a> using the <a shape="rect" 
class="external-link" 
href="http://activemq.apache.org/maven/5.5.0/activemq-camel/apidocs/org/apache/activemq/camel/component/ActiveMQComponent.html#activeMQComponent%28java.lang.String%29";><code>activeMQComponent()</code>
 method</a> while specifying the <a shape="rect" class="external-link" 
href="http://activemq.apache.org/configuring-t
 ransports.html">brokerURL</a> used to connect to ActiveMQ.</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[camelContext.addComponent(&quot;activemq&quot;,
 activeMQComponent(&quot;vm://localhost?broker.persistent=false&quot;));
-]]></script>
-</div></div><h3 
id="BookComponentAppendix-ConfiguringtheConnectionFactoryusingSpringXML">Configuring
 the Connection Factory using Spring XML</h3><p>You can configure the ActiveMQ 
broker URL on the&#160;<strong><code>ActiveMQComponent</code></strong> as 
follows</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[&lt;beans 
xmlns=&quot;http://www.springframework.org/schema/beans&quot;
-       xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
-       xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans 
+<div class="wiki-content maincontent"><div class="chapter" 
id="chapter-component-appendix"><h1 
id="BookComponentAppendix-ComponentAppendix">Component Appendix</h1><p>There 
now follows the documentation on each Camel component.</p><h2 
id="BookComponentAppendix-ActiveMQComponent">ActiveMQ Component</h2><p>The 
ActiveMQ component allows messages to be sent to a <a shape="rect" 
class="external-link" href="http://java.sun.com/products/jms/"; 
rel="nofollow">JMS</a> Queue or Topic or messages to be consumed from a JMS 
Queue or Topic using <a shape="rect" class="external-link" 
href="http://activemq.apache.org/"; title="The most popular and powerful open 
source message broker">Apache ActiveMQ</a>. This component is based on <a 
shape="rect" href="jms.html">JMS Component</a> and uses Spring's JMS support 
for declarative transactions, using Spring's 
<strong><code>JmsTemplate</code></strong> for sending and a 
<strong><code>MessageListenerContainer</code></strong> for consuming. All the 
options from
  the <a shape="rect" href="jms.html">JMS</a> component also applies for this 
component.</p><p>To use this component make sure you have the 
<strong><code>activemq.jar</code></strong> or 
<strong><code>activemq-core.jar</code></strong> on your classpath along with 
any Camel dependencies such as <strong><code>camel-core.jar</code></strong>, 
<strong><code>camel-spring.jar</code></strong> and 
<strong><code>camel-jms.jar</code></strong>.</p><parameter 
ac:name="title">Transacted and caching</parameter><rich-text-body><p>See 
section <em>Transactions and Cache Levels</em> below on <a shape="rect" 
href="jms.html">JMS</a> page if you are using transactions with <a shape="rect" 
href="jms.html">JMS</a> as it can impact performance.</p></rich-text-body><h3 
id="BookComponentAppendix-URIformat">URI 
format</h3><plain-text-body>activemq:[queue:|topic:]destinationName
+</plain-text-body><p>Where&#160;<strong><code>destinationName</code></strong> 
is an ActiveMQ queue or topic name. By default, 
the&#160;<strong><code>destinationName</code></strong> is interpreted as a 
queue name. For example, to connect to the queue, 
<strong><code>FOO.BAR</code></strong>, use:</p><plain-text-body>activemq:FOO.BAR
+</plain-text-body><p>You can include the optional 
<strong><code>queue:</code></strong> prefix, if you 
prefer:</p><plain-text-body>activemq:queue:FOO.BAR
+</plain-text-body><p>To connect to a topic, you must include the 
<strong><code>topic:</code></strong> prefix. For example, to connect to the 
topic, <strong><code>Stocks.Prices</code></strong>, 
use:</p><plain-text-body>activemq:topic:Stocks.Prices
+</plain-text-body><h3 id="BookComponentAppendix-Options">Options</h3><p>See 
Options on the <a shape="rect" href="jms.html">JMS</a> component as all these 
options also apply for this component.</p><h3 
id="BookComponentAppendix-ConfiguringtheConnectionFactory">Configuring the 
Connection Factory</h3><p>This <a shape="rect" class="external-link" 
href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQRouteTest.java";>test
 case</a> shows how to add 
an&#160;<strong><code>ActiveMQComponent</code></strong> to the <a shape="rect" 
href="camelcontext.html">CamelContext</a> using the <a shape="rect" 
class="external-link" 
href="http://activemq.apache.org/maven/5.5.0/activemq-camel/apidocs/org/apache/activemq/camel/component/ActiveMQComponent.html#activeMQComponent%28java.lang.String%29";><code>activeMQComponent()</code>
 method</a> while specifying the <a shape="rect" class="external-link" 
href="http://activemq.apache.org/configu
 ring-transports.html">brokerURL</a> used to connect to 
ActiveMQ.</p><plain-text-body>camelContext.addComponent("activemq", 
activeMQComponent("vm://localhost?broker.persistent=false"));
+</plain-text-body><h3 
id="BookComponentAppendix-ConfiguringtheConnectionFactoryusingSpringXML">Configuring
 the Connection Factory using Spring XML</h3><p>You can configure the ActiveMQ 
broker URL on the&#160;<strong><code>ActiveMQComponent</code></strong> as 
follows</p><parameter ac:name="">xml</parameter><plain-text-body>&lt;beans 
xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xsi:schemaLocation="http://www.springframework.org/schema/beans 
                            
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                            http://camel.apache.org/schema/spring 
-                           
http://camel.apache.org/schema/spring/camel-spring.xsd&quot;&gt;
+                           
http://camel.apache.org/schema/spring/camel-spring.xsd"&gt;
 
-   &lt;camelContext xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
+   &lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
    &lt;/camelContext&gt;
 
-   &lt;bean id=&quot;activemq&quot; 
class=&quot;org.apache.activemq.camel.component.ActiveMQComponent&quot;&gt;
-      &lt;property name=&quot;brokerURL&quot; 
value=&quot;tcp://somehost:61616&quot;/&gt;
+   &lt;bean id="activemq" 
class="org.apache.activemq.camel.component.ActiveMQComponent"&gt;
+      &lt;property name="brokerURL" value="tcp://somehost:61616"/&gt;
    &lt;/bean&gt;
 &lt;/beans&gt;
-]]></script>
-</div></div><h3 id="BookComponentAppendix-UsingConnectionPooling">Using 
Connection Pooling</h3><p>When sending to an ActiveMQ broker using Camel it's 
recommended to use a pooled connection factory to efficiently handle pooling of 
JMS connections, sessions and producers. This is documented on the <a 
shape="rect" class="external-link" 
href="http://activemq.apache.org/spring-support.html";>ActiveMQ Spring Support 
</a> page.</p><p>You can grab ActiveMQ's 
<strong><code>org.apache.activemq.pool.PooledConnectionFactory</code></strong> 
with Maven:</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[&lt;dependency&gt;
+</plain-text-body><h3 id="BookComponentAppendix-UsingConnectionPooling">Using 
Connection Pooling</h3><p>When sending to an ActiveMQ broker using Camel it's 
recommended to use a pooled connection factory to efficiently handle pooling of 
JMS connections, sessions and producers. This is documented on the <a 
shape="rect" class="external-link" 
href="http://activemq.apache.org/spring-support.html";>ActiveMQ Spring Support 
</a> page.</p><p>You can grab ActiveMQ's 
<strong><code>org.apache.activemq.pool.PooledConnectionFactory</code></strong> 
with Maven:</p><parameter 
ac:name="">xml</parameter><plain-text-body>&lt;dependency&gt;
    &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
    &lt;artifactId&gt;activemq-pool&lt;/artifactId&gt;
    &lt;version&gt;5.6.0&lt;/version&gt;
 &lt;/dependency&gt;
-]]></script>
-</div></div><p>And then setup the&#160;<strong><code>activemq</code></strong> 
Camel component as follows:</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[&lt;bean id=&quot;jmsConnectionFactory&quot; 
class=&quot;org.apache.activemq.ActiveMQConnectionFactory&quot;&gt;
-   &lt;property name=&quot;brokerURL&quot; 
value=&quot;tcp://localhost:61616&quot;/&gt;
+</plain-text-body><p>And then setup 
the&#160;<strong><code>activemq</code></strong> Camel component as 
follows:</p><parameter ac:name="">xml</parameter><plain-text-body>&lt;bean 
id="jmsConnectionFactory" 
class="org.apache.activemq.ActiveMQConnectionFactory"&gt;
+   &lt;property name="brokerURL" value="tcp://localhost:61616"/&gt;
 &lt;/bean&gt;
 
-&lt;bean id=&quot;pooledConnectionFactory&quot; 
class=&quot;org.apache.activemq.pool.PooledConnectionFactory&quot; 
init-method=&quot;start&quot; destroy-method=&quot;stop&quot;&gt;
-   &lt;property name=&quot;maxConnections&quot; value=&quot;8&quot;/&gt;
-   &lt;property name=&quot;connectionFactory&quot; 
ref=&quot;jmsConnectionFactory&quot;/&gt;
+&lt;bean id="pooledConnectionFactory" 
class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start" 
destroy-method="stop"&gt;
+   &lt;property name="maxConnections" value="8"/&gt;
+   &lt;property name="connectionFactory" ref="jmsConnectionFactory"/&gt;
 &lt;/bean&gt;
 
-&lt;bean id=&quot;jmsConfig&quot; 
class=&quot;org.apache.camel.component.jms.JmsConfiguration&quot;&gt;
-   &lt;property name=&quot;connectionFactory&quot; 
ref=&quot;pooledConnectionFactory&quot;/&gt;
-   &lt;property name=&quot;concurrentConsumers&quot; value=&quot;10&quot;/&gt;
+&lt;bean id="jmsConfig" 
class="org.apache.camel.component.jms.JmsConfiguration"&gt;
+   &lt;property name="connectionFactory" ref="pooledConnectionFactory"/&gt;
+   &lt;property name="concurrentConsumers" value="10"/&gt;
 &lt;/bean&gt;
 
-&lt;bean id=&quot;activemq&quot; 
class=&quot;org.apache.activemq.camel.component.ActiveMQComponent&quot;&gt;
-    &lt;property name=&quot;configuration&quot; ref=&quot;jmsConfig&quot;/&gt;
+&lt;bean id="activemq" 
class="org.apache.activemq.camel.component.ActiveMQComponent"&gt;
+    &lt;property name="configuration" ref="jmsConfig"/&gt;
 
     &lt;!-- If transacted=true then enable CACHE_CONSUMER (if not using XA) to 
run faster.
          See more details at: http://camel.apache.org/jms --&gt;
     &lt;!--
-    &lt;property name=&quot;transacted&quot; value=&quot;true&quot;/&gt;
-    &lt;property name=&quot;cacheLevelName&quot; 
value=&quot;CACHE_CONSUMER&quot;/&gt;
+   &#160;&lt;property name="transacted" value="true"/&gt;
+    &lt;property name="cacheLevelName" value="CACHE_CONSUMER"/&gt;
     --&gt;
 &lt;/bean&gt;
-]]></script>
-</div></div><div class="confluence-information-macro 
confluence-information-macro-note"><span class="aui-icon aui-icon-small 
aui-iconfont-warning confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>Notice 
the&#160;<strong><code>init</code></strong> 
and&#160;<strong><code>destroy</code></strong> methods on the pooled connection 
factory. This is important to ensure the connection pool is properly started 
and shutdown.</p></div></div><div class="confluence-information-macro 
confluence-information-macro-information"><p class="title">Important 
information about when using transactions</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 are using transactions then 
see more details at <a shape="rect" href="jms.html">JMS</a>. And remember to 
set <strong><code>cacheLevelName</code></strong> to 
<strong><code>CACHE_CONSUMER</code></strong> if you are 
 not using XA transactions. This can dramatically improve 
performance.</p></div></div><p>The 
<strong><code>PooledConnectionFactory</code></strong> will then create a 
connection pool with up to 8 connections in use at the same time. Each 
connection can be shared by many sessions. There is an option named 
<strong><code>maximumActive</code></strong> you can use to configure the 
maximum number of sessions per connection; the default value is 
<strong><code>500</code></strong>. From <strong>ActiveMQ 5.7</strong>: the 
option has been renamed to better reflect its purpose, being named as 
<strong><code>maximumActiveSessionPerConnection</code></strong>. Notice the 
<strong><code>concurrentConsumers</code></strong> is set to a higher value than 
<strong><code>maxConnections</code></strong> is. This is okay, as each consumer 
is using a session, and as a session can share the same connection, we are in 
the safe. In this example we can have&#160;<strong><code>8 * 500 = 
4000</code></strong> active se
 ssions at the same time.</p><h3 
id="BookComponentAppendix-InvokingMessageListenerPOJOsinaCamelroute">Invoking 
MessageListener POJOs in a Camel route</h3><p>The ActiveMQ component also 
provides a helper <a shape="rect" href="type-converter.html">Type Converter</a> 
from a JMS&#160;<strong><code>MessageListener</code></strong> to a <a 
shape="rect" href="processor.html">Processor</a>. This means that the <a 
shape="rect" href="bean.html">Bean</a> component is capable of invoking any 
JMS&#160;<strong><code>MessageListener</code></strong> bean directly inside any 
route.</p><p>So for example you can create 
a&#160;<strong><code>MessageListener</code></strong> in JMS like this:</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 class MyListener implements 
MessageListener {
+</plain-text-body><rich-text-body><p>Notice 
the&#160;<strong><code>init</code></strong> 
and&#160;<strong><code>destroy</code></strong> methods on the pooled connection 
factory. This is important to ensure the connection pool is properly started 
and shutdown.</p></rich-text-body><parameter ac:name="title">Important 
information about when using transactions</parameter><rich-text-body><p>If you 
are using transactions then see more details at <a shape="rect" 
href="jms.html">JMS</a>. And remember to set 
<strong><code>cacheLevelName</code></strong> to 
<strong><code>CACHE_CONSUMER</code></strong> if you are not using XA 
transactions. This can dramatically improve 
performance.</p></rich-text-body><p>The 
<strong><code>PooledConnectionFactory</code></strong> will then create a 
connection pool with up to 8 connections in use at the same time. Each 
connection can be shared by many sessions. There is an option named 
<strong><code>maximumActive</code></strong> you can use to configure the maximum
  number of sessions per connection; the default value is 
<strong><code>500</code></strong>. From <strong>ActiveMQ 5.7</strong>: the 
option has been renamed to better reflect its purpose, being named as 
<strong><code>maximumActiveSessionPerConnection</code></strong>. Notice the 
<strong><code>concurrentConsumers</code></strong> is set to a higher value than 
<strong><code>maxConnections</code></strong> is. This is okay, as each consumer 
is using a session, and as a session can share the same connection, we are in 
the safe. In this example we can have&#160;<strong><code>8 * 500 = 
4000</code></strong> active sessions at the same time.</p><h3 
id="BookComponentAppendix-InvokingMessageListenerPOJOsinaCamelroute">Invoking 
MessageListener POJOs in a Camel route</h3><p>The ActiveMQ component also 
provides a helper <a shape="rect" href="type-converter.html">Type Converter</a> 
from a JMS&#160;<strong><code>MessageListener</code></strong> to a <a 
shape="rect" href="processor.html">Processor</a>. 
 This means that the <a shape="rect" href="bean.html">Bean</a> component is 
capable of invoking any JMS&#160;<strong><code>MessageListener</code></strong> 
bean directly inside any route.</p><p>So for example you can create 
a&#160;<strong><code>MessageListener</code></strong> in JMS like 
this:</p><plain-text-body>public class MyListener implements MessageListener {
    public void onMessage(Message jmsMessage) {
        // ...
    }
 }
-]]></script>
-</div></div><p>Then use it in your Camel route as follows</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[from(&quot;file://foo/bar&quot;)
+</plain-text-body><p>Then use it in your Camel route as 
follows</p><plain-text-body>from("file://foo/bar")
   .bean(MyListener.class);
-]]></script>
-</div></div><p>That is, you can reuse any of the Camel <a shape="rect" 
href="components.html">Components</a> and easily integrate them into your 
JMS&#160;<strong><code>MessageListener</code></strong> POJO!</p><h3 
id="BookComponentAppendix-UsingActiveMQDestinationOptions">Using ActiveMQ 
Destination Options</h3><p><strong>Available as of ActiveMQ 
5.6</strong></p><p>You can configure the <a shape="rect" class="external-link" 
href="http://activemq.apache.org/destination-options.html";>Destination 
Options</a> in the endpoint URI, using 
the&#160;<strong><code>destination.</code></strong> prefix. For example to mark 
a consumer as exclusive, and set its prefetch size to 
<strong><code>50</code></strong>, you can do as follows:</p><p>&#160;</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[&lt;from 
uri=&quot;activemq:foo?destination.consumer.exclusive=true&amp;amp;destination.consumer.prefetchSize=50&quot;/&gt;]]></script>
-</div></div><h3 id="BookComponentAppendix-ConsumingAdvisoryMessages">Consuming 
Advisory Messages</h3><p>ActiveMQ can generate <a shape="rect" 
class="external-link" 
href="http://activemq.apache.org/advisory-message.html";>Advisory messages </a> 
which are put in topics that you can consume. Such messages can help you send 
alerts in case you detect slow consumers or to build statistics (number of 
messages/produced per day, etc.) The following Spring DSL example shows you how 
to read messages from a topic.</p><p>The below route starts by reading the 
topic <em>ActiveMQ.Advisory.Connection</em>. To watch another topic, simply 
change the name according to the name provided in ActiveMQ Advisory Messages 
documentation. The 
parameter&#160;<strong><code>mapJmsMessage=false</code></strong> allows for 
converting 
the&#160;<strong><code>org.apache.activemq.command.ActiveMqMessage</code></strong>
 object from the JMS queue. Next, the body received is converted into a String 
for the purposes of this e
 xample and a carriage return is added. Finally, the string is added to a 
file</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[&lt;route&gt;
-   &lt;from 
uri=&quot;activemq:topic:ActiveMQ.Advisory.Connection?mapJmsMessage=false&quot;/&gt;
-   &lt;convertBodyTo type=&quot;java.lang.String&quot;/&gt;
+</plain-text-body><p>That is, you can reuse any of the Camel <a shape="rect" 
href="components.html">Components</a> and easily integrate them into your 
JMS&#160;<strong><code>MessageListener</code></strong> POJO!</p><h3 
id="BookComponentAppendix-UsingActiveMQDestinationOptions">Using ActiveMQ 
Destination Options</h3><p><strong>Available as of ActiveMQ 
5.6</strong></p><p>You can configure the <a shape="rect" class="external-link" 
href="http://activemq.apache.org/destination-options.html";>Destination 
Options</a> in the endpoint URI, using 
the&#160;<strong><code>destination.</code></strong> prefix. For example to mark 
a consumer as exclusive, and set its prefetch size to 
<strong><code>50</code></strong>, you can do as 
follows:</p><p>&#160;</p><plain-text-body>&lt;from 
uri="activemq:foo?destination.consumer.exclusive=true&amp;amp;destination.consumer.prefetchSize=50"/&gt;</plain-text-body><h3
 id="BookComponentAppendix-ConsumingAdvisoryMessages">Consuming Advisory 
Messages</h3><p>ActiveMQ
  can generate <a shape="rect" class="external-link" 
href="http://activemq.apache.org/advisory-message.html";>Advisory messages </a> 
which are put in topics that you can consume. Such messages can help you send 
alerts in case you detect slow consumers or to build statistics (number of 
messages/produced per day, etc.) The following Spring DSL example shows you how 
to read messages from a topic.</p><p>The below route starts by reading the 
topic <em>ActiveMQ.Advisory.Connection</em>. To watch another topic, simply 
change the name according to the name provided in ActiveMQ Advisory Messages 
documentation. The 
parameter&#160;<strong><code>mapJmsMessage=false</code></strong> allows for 
converting 
the&#160;<strong><code>org.apache.activemq.command.ActiveMqMessage</code></strong>
 object from the JMS queue. Next, the body received is converted into a String 
for the purposes of this example and a carriage return is added. Finally, the 
string is added to a file</p><plain-text-body>&lt;route&gt;
+   &lt;from 
uri="activemq:topic:ActiveMQ.Advisory.Connection?mapJmsMessage=false"/&gt;
+   &lt;convertBodyTo type="java.lang.String"/&gt;
    &lt;transform&gt;
       &lt;simple&gt;${in.body}&amp;#13;&lt;/simple&gt;
    &lt;/transform&gt;
-   &lt;to 
uri=&quot;file://data/activemq/?fileExist=Append&amp;amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt&quot;/&gt;
+   &lt;to 
uri="file://data/activemq/?fileExist=Append&amp;amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"/&gt;
 &lt;/route&gt;
-]]></script>
-</div></div><p>If you consume a message on a queue, you should see the 
following files under the&#160;<strong><code>data/activemq</code></strong> 
folder :</p><p><strong><code>advisoryConnection-20100312.txt</code></strong><br 
clear="none"><strong><code>advisoryProducer-20100312.txt</code></strong></p><p>containing
 the following string:</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[ActiveMQMessage {
+</plain-text-body><p>If you consume a message on a queue, you should see the 
following files under the&#160;<strong><code>data/activemq</code></strong> 
folder :</p><p><strong><code>advisoryConnection-20100312.txt</code></strong><br 
clear="none"><strong><code>advisoryProducer-20100312.txt</code></strong></p><p>containing
 the following string:</p><plain-text-body>ActiveMQMessage {
 commandId = 0, 
 responseRequired = false, 
 messageId = ID:dell-charles-3258-1268399815140-1:0:0:0:221, 
@@ -220,16 +194,12 @@ readOnlyProperties = true,
 readOnlyBody = true, 
 droppable = false
 }
-]]></script>
-</div></div><h3 id="BookComponentAppendix-GettingComponentJAR">Getting 
Component JAR</h3><p>You will need this dependency</p><ul 
class="alternate"><li><strong><code>activemq-camel</code></strong></li></ul><p><a
 shape="rect" href="activemq.html">ActiveMQ</a> is an extension of the <a 
shape="rect" href="jms.html">JMS</a> component released with the <a 
shape="rect" class="external-link" href="http://activemq.apache.org";>ActiveMQ 
project</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[&lt;dependency&gt;
+</plain-text-body><h3 id="BookComponentAppendix-GettingComponentJAR">Getting 
Component JAR</h3><p>You will need this dependency</p><ul 
class="alternate"><li><strong><code>activemq-camel</code></strong></li></ul><p><a
 shape="rect" href="activemq.html">ActiveMQ</a> is an extension of the <a 
shape="rect" href="jms.html">JMS</a> component released with the <a 
shape="rect" class="external-link" href="http://activemq.apache.org";>ActiveMQ 
project</a>.</p><plain-text-body>&lt;dependency&gt;
   &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
   &lt;artifactId&gt;activemq-camel&lt;/artifactId&gt;
   &lt;version&gt;5.6.0&lt;/version&gt;
 &lt;/dependency&gt;
-]]></script>
-</div></div><p></p><h3 id="BookComponentAppendix-SeeAlso">See Also</h3>
-<ul><li><a shape="rect" href="configuring-camel.html">Configuring 
Camel</a></li><li><a shape="rect" 
href="component.html">Component</a></li><li><a shape="rect" 
href="endpoint.html">Endpoint</a></li><li><a shape="rect" 
href="getting-started.html">Getting Started</a></li></ul> <div 
class="error"><span class="error">Unable to render {include}</span> The 
included page could not be found.</div> <h2 
id="BookComponentAppendix-AMQP">AMQP</h2><p>The <strong style="line-height: 
1.42857;">amqp:</strong> component supports the <a shape="rect" 
class="external-link" href="http://www.amqp.org/"; rel="nofollow" 
style="line-height: 1.42857;">AMQP 1.0 protocol</a> using the JMS Client API of 
the <a shape="rect" class="external-link" 
href="https://github.com/apache/qpid-jms/"; rel="nofollow">Qpid</a> project. In 
case you want to use <strong>AMQP 0.9</strong> (in particular RabbitMQ) you 
might also be interested in the <a shape="rect" href="rabbitmq.html">Camel 
RabbitMQ</a> component. Please keep in mind
  that prior to the <strong>Camel 2.17.0</strong> AMQP component supported 
<strong>AMQP 0.9</strong> and above, however since <strong>Camel 
2.17.0</strong> it supports only <strong>AMQP 1.0</strong>.</p><p>Maven users 
will need to add the following dependency to their 
<strong><code>pom.xml</code></strong> for this component:</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</plain-text-body><p><parameter ac:name=""><a shape="rect" 
href="endpoint-see-also.html">Endpoint See Also</a></parameter></p> <div 
class="error"><span class="error">Unable to render {include}</span> The 
included page could not be found.</div> <h2 
id="BookComponentAppendix-AMQP">AMQP</h2><p>The <strong style="line-height: 
1.42857;">amqp:</strong> component supports the <a shape="rect" 
class="external-link" href="http://www.amqp.org/"; rel="nofollow" 
style="line-height: 1.42857;">AMQP 1.0 protocol</a> using the JMS Client API of 
the <a shape="rect" class="external-link" 
href="https://github.com/apache/qpid-jms/"; rel="nofollow">Qpid</a> project. In 
case you want to use <strong>AMQP 0.9</strong> (in particular RabbitMQ) you 
might also be interested in the <a shape="rect" href="rabbitmq.html">Camel 
RabbitMQ</a> component. Please keep in mind that prior to the <strong>Camel 
2.17.0</strong> AMQP component supported <strong>AMQP 0.9</strong> and above, 
however since <strong>Camel 2.17.0</st
 rong> it supports only <strong>AMQP 1.0</strong>.</p><p>Maven users will need 
to add the following dependency to their <strong><code>pom.xml</code></strong> 
for this component:</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[&lt;dependency&gt;
     &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
     &lt;artifactId&gt;camel-amqp&lt;/artifactId&gt;
@@ -310,7 +280,7 @@ AMQPConnectionDetails amqpConnection() {
 </div></div><h3 id="BookComponentAppendix-UsingamqpinsideKaraf">Using amqp 
inside Karaf</h3><p>To use the <strong><code>amqp</code></strong> component 
inside Karaf use the predefined feature called 
<strong><code>camel-amqp</code></strong> to install the necessary 
bundles.</p><p>Example:</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[karaf@root()&gt; repo-add camel
 karaf@root()&gt; feature:install camel-amqp]]></script>
-</div></div><p>and the environment would be set.</p><p>Use the 
<strong><code>camel-blueprint</code></strong> 
or&#160;<strong><code>camel-spring</code></strong> features to define routes in 
those contexts.</p><p>&#160;</p><p></p><h3 
id="BookComponentAppendix-SeeAlso.1">See Also</h3>
+</div></div><p>and the environment would be set.</p><p>Use the 
<strong><code>camel-blueprint</code></strong> 
or&#160;<strong><code>camel-spring</code></strong> features to define routes in 
those contexts.</p><p>&#160;</p><p></p><h3 
id="BookComponentAppendix-SeeAlso">See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html">Configuring 
Camel</a></li><li><a shape="rect" 
href="component.html">Component</a></li><li><a shape="rect" 
href="endpoint.html">Endpoint</a></li><li><a shape="rect" 
href="getting-started.html">Getting Started</a></li></ul><p>&#160;</p> <h2 
id="BookComponentAppendix-SQSComponent">SQS Component</h2><p><strong>Available 
as of Camel 2.6</strong></p><p>The sqs component supports sending and receiving 
messages to <a shape="rect" class="external-link" 
href="http://aws.amazon.com/sqs"; rel="nofollow">Amazon's SQS</a> 
service.</p><div class="confluence-information-macro 
confluence-information-macro-information"><p 
class="title">Prerequisites</p><span class="aui-icon aui-icon-small 
aui-iconfont-info confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>You must have a valid Amazon Web 
Services developer account, and be signed up to use Amazon SQS. More 
information are available at <a shape="rect" class="
 external-link" href="http://aws.amazon.com/sqs"; rel="nofollow">Amazon 
SQS</a>.</p></div></div><h3 id="BookComponentAppendix-URIFormat">URI 
Format</h3><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[aws-sqs://queueName[?options]
 aws-sqs://queueNameOrArn[?options] (from Camel 2.18)
@@ -342,193 +312,36 @@ registry.bind(&quot;client&quot;, client
   .filter(&quot;${header.login} == true&quot;)
   .to(&quot;mock:result&quot;);
 ]]></script>
-</div></div><p>In the above code, if an exchange doesn't have an appropriate 
header, it will not make it through the filter AND also not be deleted from the 
SQS queue. After&#160;<code>5000</code> miliseconds, the message will become 
visible to other consumers.</p><p></p><h3 
id="BookComponentAppendix-SeeAlso.2">See Also</h3>
-<ul><li><a shape="rect" href="configuring-camel.html">Configuring 
Camel</a></li><li><a shape="rect" 
href="component.html">Component</a></li><li><a shape="rect" 
href="endpoint.html">Endpoint</a></li><li><a shape="rect" 
href="getting-started.html">Getting Started</a></li></ul><ul 
class="alternate"><li><a shape="rect" href="aws.html">AWS 
Component</a></li></ul> <h2 id="BookComponentAppendix-AtomComponent">Atom 
Component</h2><p>The <strong>atom:</strong> component is used for polling Atom 
feeds.</p><p>Camel will poll the feed every 60 seconds by default.<br 
clear="none"> <strong>Note:</strong> The component currently only supports 
polling (consuming) feeds.</p><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" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
+</div></div><p>In the above code, if an exchange doesn't have an appropriate 
header, it will not make it through the filter AND also not be deleted from the 
SQS queue. After&#160;<code>5000</code> miliseconds, the message will become 
visible to other consumers.</p><p></p><h3 
id="BookComponentAppendix-SeeAlso.1">See Also</h3>
+<ul><li><a shape="rect" href="configuring-camel.html">Configuring 
Camel</a></li><li><a shape="rect" 
href="component.html">Component</a></li><li><a shape="rect" 
href="endpoint.html">Endpoint</a></li><li><a shape="rect" 
href="getting-started.html">Getting Started</a></li></ul><ul 
class="alternate"><li><a shape="rect" href="aws.html">AWS 
Component</a></li></ul> <h2 id="BookComponentAppendix-AtomComponent">Atom 
Component</h2><p>The <strong>atom:</strong> component is used for polling Atom 
feeds.</p><p>Camel will poll the feed every 60 seconds by default.<br 
clear="none"> <strong>Note:</strong> The component currently only supports 
polling (consuming) feeds.</p><p>Maven users will need to add the following 
dependency to their <code>pom.xml</code> for this component:</p><parameter 
ac:name="">xml</parameter><plain-text-body>&lt;dependency&gt;
     &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
     &lt;artifactId&gt;camel-atom&lt;/artifactId&gt;
     &lt;version&gt;x.x.x&lt;/version&gt;
     &lt;!-- use the same version as your Camel core version --&gt;
 &lt;/dependency&gt;
-]]></script>
-</div></div><h3 id="BookComponentAppendix-URIformat.2">URI format</h3><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[atom://atomUri[?options]
-]]></script>
-</div></div><p>Where <strong>atomUri</strong> is the URI to the Atom feed to 
poll.</p><h3 id="BookComponentAppendix-Options.1">Options</h3><div 
class="confluenceTableSmall"><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Property</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>splitEntries</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>If <code>true</code> Camel will 
poll the feed and for the subsequent polls return each entry poll by poll. If 
the feed contains 7 entries then Camel will return the first entry on the first 
poll, the 2nd entry on the next poll, until no more entries where as Camel will 
do a new update on the feed. If <code>false</code> the
 n Camel will poll a fresh feed on every invocation.</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code>filter</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Is only used by the split 
entries to filter the entries to return. Camel will default use the 
<code>UpdateDateFilter</code> that only return new entries from the feed. So 
the client consuming from the feed never receives the same entry more than 
once. The filter will return the entries ordered by the newest 
last.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>lastUpdate</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Is only used by the filter, as the starting 
timestamp for selection never entries (uses the <code>entry.updated</code> 
timestamp). Syntax format is: <code>yyyy-MM-ddTHH:MM:
 ss</code>. Example: <code>2007-12-24T17:45:59</code>.</p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>throttleEntries</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong>Camel 2.5:</strong> Sets whether 
all entries identified in a single feed poll should be delivered immediately. 
If <code>true</code>, only one entry is processed per 
<code>consumer.delay</code>. Only applicable when <code>splitEntries</code> is 
set to <code>true</code>.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>feedHeader</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Sets whether to add the Abdera Feed object 
as a header.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>sortEntries</code></p></td><td colspan="1" 
rowspan="1" class="confl
 uenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>If <code>splitEntries</code> is <code>true</code>, this 
sets whether to sort those entries by updated date.</p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.delay</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>500</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Delay in millis between each 
poll.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.initialDelay</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code>1000</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Millis before polling 
starts.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.userFixedDelay</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 <code>tru
 e</code>, use fixed delay between pools, otherwise fixed rate is used. See <a 
shape="rect" class="external-link" 
href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html";
 rel="nofollow">ScheduledExecutorService</a> in JDK for 
details.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>username</code></td><td colspan="1" rowspan="1" 
class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" 
class="confluenceTd"><strong>Camel 2.16:</strong> For basic authentication when 
polling from a HTTP feed</td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>password</code></td><td colspan="1" rowspan="1" 
class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" 
class="confluenceTd"><strong>Camel 2.16:</strong><span> For basic 
authentication when polling from a HTTP 
feed</span></td></tr></tbody></table></div></div>
-
-
-<p>You can append query options to the URI in the following format, 
<code>?option=value&amp;option=value&amp;...</code></p><h3 
id="BookComponentAppendix-Exchangedataformat">Exchange data format</h3><p>Camel 
will set the In body on the returned <code>Exchange</code> with the entries. 
Depending on the <code>splitEntries</code> flag Camel will either return one 
<code>Entry</code> or a <code>List&lt;Entry&gt;</code>.</p><div 
class="confluenceTableSmall"><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Value</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Behavior</p></th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>splitEntries</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Only a single entry from the currently 
being proce
 ssed feed is set: <code>exchange.in.body(Entry)</code></p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>splitEntries</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>The entire list of entries from the feed is 
set: 
<code>exchange.in.body(List&lt;Entry&gt;)</code></p></td></tr></tbody></table></div></div>
-
-
-<p>Camel can set the <code>Feed</code> object on the In header (see 
<code>feedHeader</code> option to disable this):</p><h3 
id="BookComponentAppendix-MessageHeaders">Message Headers</h3><p>Camel atom 
uses these headers.</p><div class="confluenceTableSmall"><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Header</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>CamelAtomFeed</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>When consuming the 
<code>org.apache.abdera.model.Feed</code> object is set to this 
header.</p></td></tr></tbody></table></div></div>
-
-
-<h3 id="BookComponentAppendix-Samples">Samples</h3><p>In this sample we poll 
James Strachan's blog.</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[from(&quot;atom://http://macstrac.blogspot.com/feeds/posts/default&quot;).to(&quot;seda:feeds&quot;);
-]]></script>
-</div></div><p>In this sample we want to filter only good blogs we like to a 
SEDA queue. The sample also shows how to setup Camel standalone, not running in 
any Container or using Spring.</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[
-
-// This is the CamelContext that is the heart of Camel
-private CamelContext context;
-
-protected CamelContext createCamelContext() throws Exception {
-
-    // First we register a blog service in our bean registry
-    SimpleRegistry registry = new SimpleRegistry();
-    registry.put(&quot;blogService&quot;, new BlogService());
-
-    // Then we create the camel context with our bean registry
-    context = new DefaultCamelContext(registry);
-
-    // Then we add all the routes we need using the route builder DSL syntax
-    context.addRoutes(createMyRoutes());
-
-    return context;
-}
-
-/**
- * This is the route builder where we create our routes using the Camel DSL
- */
-protected RouteBuilder createMyRoutes() throws Exception {
-    return new RouteBuilder() {
-        public void configure() throws Exception {
-            // We pool the atom feeds from the source for further processing 
in the seda queue
-            // we set the delay to 1 second for each pool as this is a unit 
test also and we can
-            // not wait the default poll interval of 60 seconds.
-            // Using splitEntries=true will during polling only fetch one Atom 
Entry at any given time.
-            // As the feed.atom file contains 7 entries, using this will 
require 7 polls to fetch the entire
-            // content. When Camel have reach the end of entries it will 
refresh the atom feed from URI source
-            // and restart - but as Camel by default uses the 
UpdatedDateFilter it will only deliver new
-            // blog entries to &quot;seda:feeds&quot;. So only when James 
Straham updates his blog with a new entry
-            // Camel will create an exchange for the seda:feeds.
-            
from(&quot;atom:file:src/test/data/feed.atom?splitEntries=true&amp;consumer.delay=1000&quot;).to(&quot;seda:feeds&quot;);
-
-            // From the feeds we filter each blot entry by using our blog 
service class
-            
from(&quot;seda:feeds&quot;).filter().method(&quot;blogService&quot;, 
&quot;isGoodBlog&quot;).to(&quot;seda:goodBlogs&quot;);
-
-            // And the good blogs is moved to a mock queue as this sample is 
also used for unit testing
-            // this is one of the strengths in Camel that you can also use the 
mock endpoint for your
-            // unit tests
-            from(&quot;seda:goodBlogs&quot;).to(&quot;mock:result&quot;);
-        }
-    };
-}
-
-/**
- * This is the actual junit test method that does the assertion that our 
routes is working as expected
- */
-@Test
-public void testFiltering() throws Exception {
-    // create and start Camel
-    context = createCamelContext();
-    context.start();
-
-    // Get the mock endpoint
-    MockEndpoint mock = context.getEndpoint(&quot;mock:result&quot;, 
MockEndpoint.class);
-
-    // There should be at least two good blog entries from the feed
-    mock.expectedMinimumMessageCount(2);
-
-    // Asserts that the above expectations is true, will throw assertions 
exception if it failed
-    // Camel will default wait max 20 seconds for the assertions to be true, 
if the conditions
-    // is true sooner Camel will continue
-    mock.assertIsSatisfied();
-
-    // stop Camel after use
-    context.stop();
-}
-
-/**
- * Services for blogs
- */
-public class BlogService {
-
-    /**
-     * Tests the blogs if its a good blog entry or not
-     */
-    public boolean isGoodBlog(Exchange exchange) {
-        Entry entry = exchange.getIn().getBody(Entry.class);
-        String title = entry.getTitle();
-
-        // We like blogs about Camel
-        boolean good = title.toLowerCase().contains(&quot;camel&quot;);
-        return good;
-    }
-
-}
-
-]]></script>
-</div></div><h3 id="BookComponentAppendix-SeeAlso.3">See Also</h3>
-<ul><li><a shape="rect" href="configuring-camel.html">Configuring 
Camel</a></li><li><a shape="rect" 
href="component.html">Component</a></li><li><a shape="rect" 
href="endpoint.html">Endpoint</a></li><li><a shape="rect" 
href="getting-started.html">Getting Started</a></li></ul><ul 
class="alternate"><li><a shape="rect" href="rss.html">RSS</a></li></ul> <h2 
id="BookComponentAppendix-BeanComponent">Bean Component</h2><p>The 
<strong>bean:</strong> component binds beans to Camel message exchanges.</p><h3 
id="BookComponentAppendix-URIformat.3">URI format</h3><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[bean:beanID[?options]
-]]></script>
-</div></div><p>Where <strong>beanID</strong> can be any string which is used 
to look up the bean in the <a shape="rect" 
href="registry.html">Registry</a></p><h3 
id="BookComponentAppendix-Options.2">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>Type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>method</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>The method name from the bean that will be 
invoked. If not provided, Camel will try to determine the method itself. In
  case of ambiguity an exception will be thrown. See <a shape="rect" 
href="bean-binding.html">Bean Binding</a> for more details. From <strong>Camel 
2.8</strong> onwards you can specify type qualifiers to pin-point the exact 
method to use for overloaded methods. From <strong>Camel 2.9</strong> onwards 
you can specify parameter values directly in the method syntax. See more 
details at <a shape="rect" href="bean-binding.html">Bean 
Binding</a>.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>cache</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</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 enabled, Camel will cache the result of 
the first <a shape="rect" href="registry.html">Registry</a> look-up. Cache can 
be enabled if the bean in the <a shape="rect" href="registry.html">Registry</a> 
is defined as a singleton scope.</p></td></
 tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>multiParameterArray</code></p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>How to treat the parameters which are 
passed from the message body; if it is <code>true</code>, the In message body 
should be an array of parameters.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>bean.xxx</p></td><td colspan="1" rowspan="1" 
class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>null</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong style="line-height: 1.42857;">Camel 
2.17:</strong>&#160;To configure additional options on the create bean instance 
from the class name. For example to configure a foo option on the bean, use 
bean.foo=123.</p></td></tr></tbody></table></div></div>
-
-
-<p>You can append query options to the URI in the following format, 
<code>?option=value&amp;option=value&amp;...</code></p><h3 
id="BookComponentAppendix-Using">Using</h3><p>The object instance that is used 
to consume messages must be explicitly registered with the <a shape="rect" 
href="registry.html">Registry</a>. For example, if you are using Spring you 
must define the bean in the Spring configuration, <code>spring.xml</code>; or 
if you don't use Spring, by registering the bean in JNDI.</p><div 
class="error"><span class="error">Error formatting macro: snippet: 
java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>Once an 
endpoint has been registered, you can build Camel routes that use it to process 
exchanges.<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[
-// lets add simple route
-camelContext.addRoutes(new RouteBuilder() {
-    public void configure() {
-        from(&quot;direct:hello&quot;).transform().constant(&quot;Good 
Bye!&quot;);
-    }
-});
-]]></script>
-</div></div>A <strong>bean:</strong> endpoint cannot be defined as the input 
to the route; i.e. you cannot consume from it, you can only route from some 
inbound message <a shape="rect" href="endpoint.html">Endpoint</a> to the bean 
endpoint as output. So consider using a <strong>direct:</strong> or 
<strong>queue:</strong> endpoint as the input.<p>You can use the 
<code>createProxy()</code> methods on <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>
 to create a proxy that will generate BeanExchanges and send them to any 
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[
-ISay proxy = new 
ProxyBuilder(camelContext).endpoint(&quot;direct:hello&quot;).build(ISay.class);
-String rc = proxy.say();
-assertEquals(&quot;Good Bye!&quot;, rc);
-]]></script>
-</div></div>And the same route using Spring DSL:<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[&lt;route&gt;
-   &lt;from uri=&quot;direct:hello&quot;&gt;
-   &lt;to uri=&quot;bean:bye&quot;/&gt;
+</plain-text-body><h3 id="BookComponentAppendix-URIformat.2">URI 
format</h3><plain-text-body>atom://atomUri[?options]
+</plain-text-body><p>Where <strong>atomUri</strong> is the URI to the Atom 
feed to poll.</p><h3 
id="BookComponentAppendix-Options.1">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>Property</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>splitEntries</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>If <code>true</code> Camel will 
poll the feed and for the subsequent polls return each entry poll by poll. If 
the feed contains 7 entries then Camel will return the first entry on the first 
poll, the 2nd entry on the next poll, until no more entries where as Camel will 
do a ne
 w update on the feed. If <code>false</code> then Camel will poll a fresh feed 
on every invocation.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>filter</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Is only used by the split entries to filter the entries 
to return. Camel will default use the <code>UpdateDateFilter</code> that only 
return new entries from the feed. So the client consuming from the feed never 
receives the same entry more than once. The filter will return the entries 
ordered by the newest last.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>lastUpdate</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Is only used by the filter, as the starting 
timestamp for selection never entries (uses the <code>entry.updated</code> 
timest
 amp). Syntax format is: <code>yyyy-MM-ddTHH:MM:ss</code>. Example: 
<code>2007-12-24T17:45:59</code>.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>throttleEntries</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong>Camel 2.5:</strong> Sets whether 
all entries identified in a single feed poll should be delivered immediately. 
If <code>true</code>, only one entry is processed per 
<code>consumer.delay</code>. Only applicable when <code>splitEntries</code> is 
set to <code>true</code>.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>feedHeader</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Sets whether to add the Abdera Feed object 
as a header.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>sortEntries</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 <code>splitEntries</code> is <code>true</code>, this 
sets whether to sort those entries by updated date.</p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.delay</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>500</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Delay in millis between each 
poll.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.initialDelay</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code>1000</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Millis before polling 
starts.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>consumer.userFixedDelay</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td 
colspan="1" r
 owspan="1" class="confluenceTd"><p>If <code>true</code>, use fixed delay 
between pools, otherwise fixed rate is used. See <a shape="rect" 
class="external-link" 
href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html";
 rel="nofollow">ScheduledExecutorService</a> in JDK for 
details.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>username</code></td><td colspan="1" rowspan="1" 
class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" 
class="confluenceTd"><strong>Camel 2.16:</strong> For basic authentication when 
polling from a HTTP feed</td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>password</code></td><td colspan="1" rowspan="1" 
class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" 
class="confluenceTd"><strong>Camel 2.16:</strong><span> For basic 
authentication when polling from a HTTP 
feed</span></td></tr></tbody></table></div></rich-text-body><p>You can append 
query options to the URI in th
 e following format, <code>?option=value&amp;option=value&amp;...</code></p><h3 
id="BookComponentAppendix-Exchangedataformat">Exchange data format</h3><p>Camel 
will set the In body on the returned <code>Exchange</code> with the entries. 
Depending on the <code>splitEntries</code> flag Camel will either return one 
<code>Entry</code> or a <code>List&lt;Entry&gt;</code>.</p><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>Option</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Value</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Behavior</p></th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>splitEntries</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Only a single entry from the currently 
being processed fe
 ed is set: <code>exchange.in.body(Entry)</code></p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>splitEntries</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>The entire list of entries from the feed is 
set: 
<code>exchange.in.body(List&lt;Entry&gt;)</code></p></td></tr></tbody></table></div></rich-text-body><p>Camel
 can set the <code>Feed</code> object on the In header (see 
<code>feedHeader</code> option to disable this):</p><h3 
id="BookComponentAppendix-MessageHeaders">Message Headers</h3><p>Camel atom 
uses these headers.</p><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>Header</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><
 code>CamelAtomFeed</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>When consuming the 
<code>org.apache.abdera.model.Feed</code> object is set to this 
header.</p></td></tr></tbody></table></div></rich-text-body><h3 
id="BookComponentAppendix-Samples">Samples</h3><p>In this sample we poll James 
Strachan's 
blog.</p><plain-text-body>from("atom://http://macstrac.blogspot.com/feeds/posts/default";).to("seda:feeds");
+</plain-text-body><p>In this sample we want to filter only good blogs we like 
to a SEDA queue. The sample also shows how to setup Camel standalone, not 
running in any Container or using 
Spring.<plain-text-body>{snippet:id=e1|lang=java|url=camel/trunk/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomGoodBlogsTest.java}</plain-text-body><parameter
 ac:name=""><a shape="rect" href="endpoint-see-also.html">Endpoint See 
Also</a></parameter></p><ul class="alternate"><li><a shape="rect" 
href="rss.html">RSS</a></li></ul> <h2 
id="BookComponentAppendix-BeanComponent">Bean Component</h2><p>The 
<strong>bean:</strong> component binds beans to Camel message exchanges.</p><h3 
id="BookComponentAppendix-URIformat.3">URI 
format</h3><plain-text-body>bean:beanID[?options]
+</plain-text-body><p>Where <strong>beanID</strong> can be any string which is 
used to look up the bean in the <a shape="rect" 
href="registry.html">Registry</a></p><h3 
id="BookComponentAppendix-Options.2">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>Type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>method</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>The method name from the bean that will be 
invoked. If not provided, Ca
 mel will try to determine the method itself. In case of ambiguity an exception 
will be thrown. See <a shape="rect" href="bean-binding.html">Bean Binding</a> 
for more details. From <strong>Camel 2.8</strong> onwards you can specify type 
qualifiers to pin-point the exact method to use for overloaded methods. From 
<strong>Camel 2.9</strong> onwards you can specify parameter values directly in 
the method syntax. See more details at <a shape="rect" 
href="bean-binding.html">Bean Binding</a>.</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>cache</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>boolean</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 enabled, Camel will cache 
the result of the first <a shape="rect" href="registry.html">Registry</a> 
look-up. Cache can be enabled if the bean in the <a shape="rect" 
href="registry.html">Registry<
 /a> is defined as a singleton scope.</p></td></tr><tr><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p><code>multiParameterArray</code></p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>boolean</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>How to treat the parameters which are 
passed from the message body; if it is <code>true</code>, the In message body 
should be an array of parameters.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>bean.xxx</p></td><td colspan="1" rowspan="1" 
class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>null</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong style="line-height: 1.42857;">Camel 
2.17:</strong>&#160;To configure additional options on the create bean instance 
from the class name. For example to configure a foo option on the bean, use 
bean.foo=123.</p></td></t
 r></tbody></table></div></rich-text-body><p>You can append query options to 
the URI in the following format, 
<code>?option=value&amp;option=value&amp;...</code></p><h3 
id="BookComponentAppendix-Using">Using</h3><p>The object instance that is used 
to consume messages must be explicitly registered with the <a shape="rect" 
href="registry.html">Registry</a>. For example, if you are using Spring you 
must define the bean in the Spring configuration, <code>spring.xml</code>; or 
if you don't use Spring, by registering the bean in 
JNDI.<plain-text-body>{snippet:id=register|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java}</plain-text-body>Once
 an endpoint has been registered, you can build Camel routes that use it to 
process 
exchanges.<plain-text-body>{snippet:id=route|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java}</plain-text-body>A
 <strong>bean:</strong> endpoint cannot be defined a
 s the input to the route; i.e. you cannot consume from it, you can only route 
from some inbound message <a shape="rect" href="endpoint.html">Endpoint</a> to 
the bean endpoint as output. So consider using a <strong>direct:</strong> or 
<strong>queue:</strong> endpoint as the input.</p><p>You can use the 
<code>createProxy()</code> methods on <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>
 to create a proxy that will generate BeanExchanges and send them to any 
endpoint:<plain-text-body>{snippet:id=invoke|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java}</plain-text-body>And
 the same route using Spring DSL:</p><parameter 
ac:name="">xml</parameter><plain-text-body>&lt;route&gt;
+   &lt;from uri="direct:hello"&gt;
+   &lt;to uri="bean:bye"/&gt;
 &lt;/route&gt;
-]]></script>
-</div></div><h3 id="BookComponentAppendix-Beanasendpoint">Bean as 
endpoint</h3><p>Camel also supports invoking <a shape="rect" 
href="bean.html">Bean</a> as an Endpoint. In the route below:</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[
-&lt;camelContext xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
-  &lt;route&gt;
-    &lt;from uri=&quot;direct:start&quot;/&gt;
-    &lt;to uri=&quot;myBean&quot;/&gt;
-    &lt;to uri=&quot;mock:results&quot;/&gt;
-  &lt;/route&gt;
-&lt;/camelContext&gt;
-
-&lt;bean id=&quot;myBean&quot; 
class=&quot;org.apache.camel.spring.bind.ExampleBean&quot;/&gt;
-]]></script>
-</div></div>What happens is that when the exchange is routed to the 
<code>myBean</code> Camel will use the <a shape="rect" 
href="bean-binding.html">Bean Binding</a> to invoke the bean.<br clear="none"> 
The source for the bean is just a plain POJO:<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 class ExampleBean {
-
-    public String sayHello(String name) {
-        return &quot;Hello &quot; + name + &quot;!&quot;;
-    }
-}
-]]></script>
-</div></div>Camel will use <a shape="rect" href="bean-binding.html">Bean 
Binding</a> to invoke the <code>sayHello</code> method, by converting the 
Exchange's In body to the <code>String</code> type and storing the output of 
the method on the Exchange Out body.<h3 
id="BookComponentAppendix-JavaDSLbeansyntax">Java DSL bean syntax</h3><p>Java 
DSL comes with syntactic sugar for the <a shape="rect" 
href="bean.html">Bean</a> component. Instead of specifying the bean explicitly 
as the endpoint (i.e. <code>to("bean:beanName")</code>) you can use the 
following 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[// Send message to the bean endpoint
+</plain-text-body><h3 id="BookComponentAppendix-Beanasendpoint">Bean as 
endpoint</h3><p>Camel also supports invoking <a shape="rect" 
href="bean.html">Bean</a> as an Endpoint. In the route 
below:<plain-text-body>{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/bind/beanAsEndpoint.xml}</plain-text-body>What
 happens is that when the exchange is routed to the <code>myBean</code> Camel 
will use the <a shape="rect" href="bean-binding.html">Bean Binding</a> to 
invoke the bean.<br clear="none"> The source for the bean is just a plain 
POJO:<plain-text-body>{snippet:id=e1|lang=java|url=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/bind/ExampleBean.java}</plain-text-body>Camel
 will use <a shape="rect" href="bean-binding.html">Bean Binding</a> to invoke 
the <code>sayHello</code> method, by converting the Exchange's In body to the 
<code>String</code> type and storing the output of the method on the Exchange 
Out
  body.</p><h3 id="BookComponentAppendix-JavaDSLbeansyntax">Java DSL bean 
syntax</h3><p>Java DSL comes with syntactic sugar for the <a shape="rect" 
href="bean.html">Bean</a> component. Instead of specifying the bean explicitly 
as the endpoint (i.e. <code>to("bean:beanName")</code>) you can use the 
following syntax:</p><parameter ac:name="">java</parameter><plain-text-body>// 
Send message to the bean endpoint
 // and invoke method resolved using Bean Binding.
-from(&quot;direct:start&quot;).beanRef(&quot;beanName&quot;);
+from("direct:start").beanRef("beanName");
 
 // Send message to the bean endpoint
 // and invoke given method.
-from(&quot;direct:start&quot;).beanRef(&quot;beanName&quot;, 
&quot;methodName&quot;);
-]]></script>
-</div></div><p>Instead of passing name of the reference to the bean (so that 
Camel will lookup for it in the registry), you can specify the bean 
itself:</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[// Send message to the given bean instance.
-from(&quot;direct:start&quot;).bean(new ExampleBean());
+from("direct:start").beanRef("beanName", "methodName");
+</plain-text-body><p>Instead of passing name of the reference to the bean (so 
that Camel will lookup for it in the registry), you can specify the bean 
itself:</p><parameter ac:name="">java</parameter><plain-text-body>// Send 
message to the given bean instance.
+from("direct:start").bean(new ExampleBean());
 
 // Explicit selection of bean method to be invoked.
-from(&quot;direct:start&quot;).bean(new ExampleBean(), &quot;methodName&quot;);
+from("direct:start").bean(new ExampleBean(), "methodName");
 
 // Camel will create the instance of bean and cache it for you.
-from(&quot;direct:start&quot;).bean(ExampleBean.class);
-]]></script>
-</div></div><h3 id="BookComponentAppendix-BeanBinding">Bean Binding</h3><p>How 
bean methods to be invoked are chosen (if they are not specified explicitly 
through the <strong>method</strong> parameter) and how parameter values are 
constructed from the <a shape="rect" href="message.html">Message</a> are all 
defined by the <a shape="rect" href="bean-binding.html">Bean Binding</a> 
mechanism which is used throughout all of the various <a shape="rect" 
href="bean-integration.html">Bean Integration</a> mechanisms in 
Camel.</p><p></p><h3 id="BookComponentAppendix-SeeAlso.4">See Also</h3>
-<ul><li><a shape="rect" href="configuring-camel.html">Configuring 
Camel</a></li><li><a shape="rect" 
href="component.html">Component</a></li><li><a shape="rect" 
href="endpoint.html">Endpoint</a></li><li><a shape="rect" 
href="getting-started.html">Getting Started</a></li></ul><ul><li><a 
shape="rect" href="class.html">Class</a> component</li><li><a shape="rect" 
href="bean-binding.html">Bean Binding</a></li><li><a shape="rect" 
href="bean-integration.html">Bean Integration</a></li></ul> <div 
class="error"><span class="error">Unable to render {include}</span> The 
included page could not be found.</div> <h2 
id="BookComponentAppendix-BrowseComponent">Browse Component</h2>
+from("direct:start").bean(ExampleBean.class);
+</plain-text-body><h3 id="BookComponentAppendix-BeanBinding">Bean 
Binding</h3><p>How bean methods to be invoked are chosen (if they are not 
specified explicitly through the <strong>method</strong> parameter) and how 
parameter values are constructed from the <a shape="rect" 
href="message.html">Message</a> are all defined by the <a shape="rect" 
href="bean-binding.html">Bean Binding</a> mechanism which is used throughout 
all of the various <a shape="rect" href="bean-integration.html">Bean 
Integration</a> mechanisms in Camel.</p><p><parameter ac:name=""><a 
shape="rect" href="endpoint-see-also.html">Endpoint See 
Also</a></parameter></p><ul><li><a shape="rect" href="class.html">Class</a> 
component</li><li><a shape="rect" href="bean-binding.html">Bean 
Binding</a></li><li><a shape="rect" href="bean-integration.html">Bean 
Integration</a></li></ul> <div class="error"><span class="error">Unable to 
render {include}</span> The included page could not be found.</div> <h2 
id="BookComponentAppendix
 -BrowseComponent">Browse Component</h2>
 
 <p>The Browse component provides a simple <a shape="rect" 
href="browsableendpoint.html">BrowsableEndpoint</a> which can be useful for 
testing, visualisation tools or debugging. The exchanges sent to the endpoint 
are all available to be browsed.</p>
 
@@ -571,7 +384,7 @@ browse:someName[?options]
 </div></div>
 
 
-<h3 id="BookComponentAppendix-SeeAlso.5">See Also</h3>
+<h3 id="BookComponentAppendix-SeeAlso.2">See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html">Configuring 
Camel</a></li><li><a shape="rect" 
href="component.html">Component</a></li><li><a shape="rect" 
href="endpoint.html">Endpoint</a></li><li><a shape="rect" 
href="getting-started.html">Getting Started</a></li></ul> <h2 
id="BookComponentAppendix-CacheComponent">Cache Component</h2><div 
class="confluence-information-macro confluence-information-macro-warning"><span 
class="aui-icon aui-icon-small aui-iconfont-error 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>This component is deprecated. As 
of Camel 2.18.0 You should use <a shape="rect" 
href="ehcache.html">Ehcache</a>.</p></div></div><p><strong>Available as of 
Camel 2.1</strong></p><p>The <strong>cache</strong> component enables you to 
perform caching operations using EHCache as the Cache Implementation. The cache 
itself is created on demand or if a cache of that name already exists then it 
is simply utilized with its original s
 ettings.</p><p>This component supports producer and event based consumer 
endpoints.</p><p>The Cache consumer is an event based consumer and can be used 
to listen and respond to specific cache activities. If you need to perform 
selections from a pre-existing cache, use the processors defined for the cache 
component.</p><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" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
     &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
@@ -767,7 +580,7 @@ browse:someName[?options]
         
.to(&quot;class:org.apache.camel.component.bean.MyPrefixBean?cool=#foo&quot;)
         .to(&quot;mock:result&quot;);
 ]]></script>
-</div></div><p>Which will lookup a bean from the <a shape="rect" 
href="registry.html">Registry</a> with the id <code>foo</code> and invoke the 
<code>setCool</code> method on the created instance of the 
<code>MyPrefixBean</code> class.</p><div class="confluence-information-macro 
confluence-information-macro-tip"><p class="title">See more</p><span 
class="aui-icon aui-icon-small aui-iconfont-approve 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>See more details at the <a 
shape="rect" href="bean.html">Bean</a> component as the <strong>class</strong> 
component works in much the same way.</p></div></div><p></p><h3 
id="BookComponentAppendix-SeeAlso.6">See Also</h3>
+</div></div><p>Which will lookup a bean from the <a shape="rect" 
href="registry.html">Registry</a> with the id <code>foo</code> and invoke the 
<code>setCool</code> method on the created instance of the 
<code>MyPrefixBean</code> class.</p><div class="confluence-information-macro 
confluence-information-macro-tip"><p class="title">See more</p><span 
class="aui-icon aui-icon-small aui-iconfont-approve 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>See more details at the <a 
shape="rect" href="bean.html">Bean</a> component as the <strong>class</strong> 
component works in much the same way.</p></div></div><p></p><h3 
id="BookComponentAppendix-SeeAlso.3">See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html">Configuring 
Camel</a></li><li><a shape="rect" 
href="component.html">Component</a></li><li><a shape="rect" 
href="endpoint.html">Endpoint</a></li><li><a shape="rect" 
href="getting-started.html">Getting Started</a></li></ul><ul><li><a 
shape="rect" href="bean.html">Bean</a></li><li><a shape="rect" 
href="bean-binding.html">Bean Binding</a></li><li><a shape="rect" 
href="bean-integration.html">Bean Integration</a></li></ul> <h2 
id="BookComponentAppendix-CometdComponent">Cometd Component</h2><p>The 
<strong>cometd:</strong> component is a transport for working with the <a 
shape="rect" class="external-link" href="http://www.mortbay.org/jetty"; 
rel="nofollow">jetty</a> implementation of the <a shape="rect" 
class="external-link" 
href="http://docs.codehaus.org/display/JETTY/Cometd+%28aka+Bayeux%29"; 
rel="nofollow">cometd/bayeux protocol</a>.<br clear="none"> Using this 
component in combination with the dojo toolkit library it's possible to push
  Camel messages directly into the browser using an AJAX based 
mechanism.</p><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" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
     &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
@@ -828,7 +641,7 @@ commetdComponent.setSslContextParameters
 ...
   &lt;to 
uri=&quot;cometds://127.0.0.1:443/service/test?baseResource=file:./target/test-classes/webapp&amp;timeout=240000&amp;interval=0&amp;maxInterval=30000&amp;multiFrameInterval=1500&amp;jsonCommented=true&amp;logLevel=2&quot;/&gt;...
 ]]></script>
-</div></div><p></p><h3 id="BookComponentAppendix-SeeAlso.7">See Also</h3>
+</div></div><p></p><h3 id="BookComponentAppendix-SeeAlso.4">See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html">Configuring 
Camel</a></li><li><a shape="rect" 
href="component.html">Component</a></li><li><a shape="rect" 
href="endpoint.html">Endpoint</a></li><li><a shape="rect" 
href="getting-started.html">Getting Started</a></li></ul> <h2 
id="BookComponentAppendix-ContextComponent">Context 
Component</h2><p><strong>Available as of Camel 2.7</strong></p><div 
class="confluence-information-macro confluence-information-macro-warning"><span 
class="aui-icon aui-icon-small aui-iconfont-error 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>Deprecated do NOT 
use</p></div></div><p>&#160;</p><p>The <strong>context</strong> component 
allows you to create new Camel Components from a CamelContext with a number of 
routes which is then treated as a black box, allowing you to refer to the local 
endpoints within the component from other CamelContexts.</p><p>It is similar to 
the <a shape="rect" href="routebox.html">Rou
 tebox</a> component in idea, though the Context component tries to be really 
simple for end users; just a simple convention over configuration approach to 
refer to local endpoints inside the CamelContext Component.</p><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" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
     &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
@@ -884,605 +697,138 @@ registry.bind(&quot;accounts&quot;, blac
   &lt;/route&gt;
 &lt;/camelContext&gt;
 ]]></script>
-</div></div><h4 id="BookComponentAppendix-Namingendpoints">Naming 
endpoints</h4><p>A context component instance can have many public input and 
output endpoints that can be accessed from outside it's CamelContext. When 
there are many it is recommended that you use logical names for them to hide 
the middleware as shown above.</p><p>However when there is only one input, 
output or error/dead letter endpoint in a component we recommend using the 
common posix shell names <strong>in</strong>, <strong>out</strong> and 
<strong>err</strong></p> <h2 
id="BookComponentAppendix-CryptocomponentforDigitalSignatures">Crypto component 
for Digital Signatures</h2><p><strong>Available as of Camel 
2.3</strong></p><p>With Camel cryptographic endpoints and Java's Cryptographic 
extension it is easy to create Digital Signatures for <a shape="rect" 
href="exchange.html">Exchange</a>s. Camel provides a pair of flexible endpoints 
which get used in concert to create a signature for an exchange in one part of 
the 
 exchange's workflow and then verify the signature in a later part of the 
workflow.</p><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" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
+</div></div><h4 id="BookComponentAppendix-Namingendpoints">Naming 
endpoints</h4><p>A context component instance can have many public input and 
output endpoints that can be accessed from outside it's CamelContext. When 
there are many it is recommended that you use logical names for them to hide 
the middleware as shown above.</p><p>However when there is only one input, 
output or error/dead letter endpoint in a component we recommend using the 
common posix shell names <strong>in</strong>, <strong>out</strong> and 
<strong>err</strong></p> <h2 
id="BookComponentAppendix-CryptocomponentforDigitalSignatures">Crypto component 
for Digital Signatures</h2><p><strong>Available as of Camel 
2.3</strong></p><p>With Camel cryptographic endpoints and Java's Cryptographic 
extension it is easy to create Digital Signatures for <a shape="rect" 
href="exchange.html">Exchange</a>s. Camel provides a pair of flexible endpoints 
which get used in concert to create a signature for an exchange in one part of 
the 
 exchange's workflow and then verify the signature in a later part of the 
workflow.</p><p>Maven users will need to add the following dependency to their 
<code>pom.xml</code> for this component:</p><parameter 
ac:name="">xml</parameter><plain-text-body>&lt;dependency&gt;
     &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
     &lt;artifactId&gt;camel-crypto&lt;/artifactId&gt;
     &lt;version&gt;x.x.x&lt;/version&gt;
     &lt;!-- use the same version as your Camel core version --&gt;
 &lt;/dependency&gt;
-]]></script>
-</div></div><h3 
id="BookComponentAppendix-Introduction">Introduction</h3><p>Digital signatures 
make use of Asymmetric Cryptographic techniques to sign messages. From a (very) 
high level, the algorithms use pairs of complimentary keys with the special 
property that data encrypted with one key can only be decrypted with the other. 
One, the private key, is closely guarded and used to 'sign' the message while 
the other, public key, is shared around to anyone interested in verifying the 
signed messages. Messages are signed by using the private key to encrypting a 
digest of the message. This encrypted digest is transmitted along with the 
message. On the other side the verifier recalculates the message digest and 
uses the public key to decrypt the the digest in the signature. If both digests 
match the verifier knows only the holder of the private key could have created 
the signature.</p><p>Camel uses the Signature service from the Java 
Cryptographic Extension to do all the heavy cryptograp
 hic lifting required to create exchange signatures. The following are some 
excellent resources for explaining the mechanics of Cryptography, Message 
digests and Digital Signatures and how to leverage them with the JCE.</p><ul 
class="alternate"><li>Bruce Schneier's Applied Cryptography</li><li>Beginning 
Cryptography with Java by David Hook</li><li>The ever insightful Wikipedia <a 
shape="rect" class="external-link" 
href="http://en.wikipedia.org/wiki/Digital_signature"; 
rel="nofollow">Digital_signatures</a></li></ul><h3 
id="BookComponentAppendix-URIformat.9">URI format</h3><p>As mentioned Camel 
provides a pair of crypto endpoints to create and verify signatures</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[crypto:sign:name[?options]

[... 7996 lines stripped ...]

Reply via email to