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 Tue Mar 26 22:22:28 2019 @@ -203,17 +203,17 @@ droppable = false <artifactId>activemq-camel</artifactId> <version>5.6.0</version> </dependency> -</plain-text-body><p><parameter ac:name=""><a shape="rect" href="endpoint-see-also.html">Endpoint See Also</a></parameter></p></div> <div class="error conf-macro output-block" data-hasbody="false" data-macro-name="include"><span class="error">Unable to render {include}</span> The included page could not be found.</div> <div class="conf-macro output-block" data-hasbody="false" data-macro-name="include"><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 conf-macro output-block" data-hasbody="true" data-macro-name="code" 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> <div class="error conf-macro output-block" data-hasbody="false" data-macro-name="include"><span class="error">Unable to render {include}</span> The included page could not be found.</div> <div class="conf-macro output-block" data-hasbody="false" data-macro-name="include"><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/" style="line-height: 1.42857;" rel="nofollow">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 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-amqp</artifactId> <version>${camel.version}</version> <!-- use the same version as your Camel core version --> </dependency> </pre> -</div></div><h3 id="BookComponentAppendix-URIformat.1">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="BookComponentAppendix-URIformat.1">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">amqp:[queue:|topic:]destinationName[?options] </pre> -</div></div><h3 id="BookComponentAppendix-AMQPOptions">AMQP Options</h3><p>You can specify all of the various configuration options of the <a shape="rect" href="jms.html">JMS</a> component after the destination name.</p><h3 id="BookComponentAppendix-Usage">Usage</h3><p>As AMQP component inherits from the JMS component. The usage of the former is almost identical to the latter:</p><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Using AMQP component</b></div><div class="codeContent panelContent pdl"> +</div></div><h3 id="BookComponentAppendix-AMQPOptions">AMQP Options</h3><p>You can specify all of the various configuration options of the <a shape="rect" href="jms.html">JMS</a> component after the destination name.</p><h3 id="BookComponentAppendix-Usage">Usage</h3><p>As AMQP component inherits from the JMS component. The usage of the former is almost identical to the latter:</p><div class="code panel pdl conf-macro output-block" style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Using AMQP component</b></div><div class="codeContent panelContent pdl"> <pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java; gutter: false; theme: Default" data-theme="Default">// Consuming from AMQP queue from("amqp:queue:incoming") .to(...); @@ -221,13 +221,13 @@ from("amqp:queue:incoming") // Sending message to the AMQP topic from(...) .to("amqp:topic:notify");</pre> -</div></div><h3 id="BookComponentAppendix-ConfiguringAMQPcomponent"><span style="line-height: 1.5;">Configuring AMQP component</span></h3><p>Starting from the <strong>Camel 2.16.1</strong> you can also use the <strong><code>AMQPComponent#amqp10Component(String connectionURI)</code></strong> factory method to return the <strong>AMQP 1.0</strong> component with the pre-configured topic prefix: </p><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Creating AMQP 1.0 component</b></div><div class="codeContent panelContent pdl"> +</div></div><h3 id="BookComponentAppendix-ConfiguringAMQPcomponent"><span style="line-height: 1.5;">Configuring AMQP component</span></h3><p>Starting from the <strong>Camel 2.16.1</strong> you can also use the <strong><code>AMQPComponent#amqp10Component(String connectionURI)</code></strong> factory method to return the <strong>AMQP 1.0</strong> component with the pre-configured topic prefix: </p><div class="code panel pdl conf-macro output-block" style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Creating AMQP 1.0 component</b></div><div class="codeContent panelContent pdl"> <pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java; gutter: false; theme: Default" data-theme="Default"> AMQPComponent amqp = AMQPComponent.amqp10Component("amqp://guest:guest@localhost:5672");</pre> -</div></div><p>Keep in mind that starting from the <strong>Camel 2.17</strong> the <strong><code>AMQPComponent#amqp10Component(String connectionURI)</code></strong> factory method has been deprecated on the behalf of the <strong><code>AMQPComponent#amqpComponent(String connectionURI)</code></strong>: </p><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Creating AMQP 1.0 component</b></div><div class="codeContent panelContent pdl"> +</div></div><p>Keep in mind that starting from the <strong>Camel 2.17</strong> the <strong><code>AMQPComponent#amqp10Component(String connectionURI)</code></strong> factory method has been deprecated on the behalf of the <strong><code>AMQPComponent#amqpComponent(String connectionURI)</code></strong>: </p><div class="code panel pdl conf-macro output-block" style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Creating AMQP 1.0 component</b></div><div class="codeContent panelContent pdl"> <pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java; gutter: false; theme: Default" data-theme="Default">AMQPComponent amqp = AMQPComponent.amqpComponent("amqp://localhost:5672");   AMQPComponent authorizedAmqp = AMQPComponent.amqpComponent("amqp://localhost:5672", "user", "password");</pre> -</div></div><p>Starting from <strong>Camel 2.17</strong>, in order to automatically configure the AMQP component, you can also add an instance of <strong><code>org.apache.camel.component.amqp.AMQPConnectionDetails</code></strong> to the registry. For example for Spring Boot you just have to define bean:</p><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>AMQP connection details auto-configuration</b></div><div class="codeContent panelContent pdl"> +</div></div><p>Starting from <strong>Camel 2.17</strong>, in order to automatically configure the AMQP component, you can also add an instance of <strong><code>org.apache.camel.component.amqp.AMQPConnectionDetails</code></strong> to the registry. For example for Spring Boot you just have to define bean:</p><div class="code panel pdl conf-macro output-block" style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>AMQP connection details auto-configuration</b></div><div class="codeContent panelContent pdl"> <pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java; gutter: false; theme: Default" data-theme="Default">@Bean AMQPConnectionDetails amqpConnection() { return new AMQPConnectionDetails("amqp://lcoalhost:5672"); @@ -237,7 +237,7 @@ AMQPConnectionDetails amqpConnection() { AMQPConnectionDetails securedAmqpConnection() { return new AMQPConnectionDetails("amqp://lcoalhost:5672", "username", "password"); }</pre> -</div></div><p> </p><p>You can also rely on the <a shape="rect" href="properties.html">Camel properties</a> to read the AMQP connection details. The factory method <strong><code>AMQPConnectionDetails.discoverAMQP()</code></strong> attempts to read Camel properties in a Kubernetes-like convention, just as demonstrated on the snippet below:</p><p> </p><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>AMQP connection details auto-configuration</b></div><div class="codeContent panelContent pdl"> +</div></div><p> </p><p>You can also rely on the <a shape="rect" href="properties.html">Camel properties</a> to read the AMQP connection details. The factory method <strong><code>AMQPConnectionDetails.discoverAMQP()</code></strong> attempts to read Camel properties in a Kubernetes-like convention, just as demonstrated on the snippet below:</p><p> </p><div class="code panel pdl conf-macro output-block" style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>AMQP connection details auto-configuration</b></div><div class="codeContent panelContent pdl"> <pre class="syntaxhighlighter-pre" data-syntaxhighlighter-params="brush: java; gutter: false; theme: Default" data-theme="Default">export AMQP_SERVICE_HOST = "mybroker.com" export AMQP_SERVICE_PORT = "6666" export AMQP_SERVICE_USERNAME = "username" @@ -250,7 +250,7 @@ AMQPConnectionDetails amqpConnection() { return AMQPConnectionDetails.discoverAMQP(); } </pre> -</div></div><h3 id="BookComponentAppendix-ConfiguringConnectionFactory">Configuring Connection Factory</h3><p>Like with any other JMS-based component, usually it's important to configure JMS connection factory. For example, you'd like to set your broker URL or set proper connection credentials. Additionally, you would always want to set some kind of pooling (or caching) on the connection factory. An example of how to do both of these tasks is 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><h3 id="BookComponentAppendix-ConfiguringConnectionFactory">Configuring Connection Factory</h3><p>Like with any other JMS-based component, usually it's important to configure JMS connection factory. For example, you'd like to set your broker URL or set proper connection credentials. Additionally, you would always want to set some kind of pooling (or caching) on the connection factory. An example of how to do both of these tasks is 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: xml; gutter: false; theme: Default" data-theme="Default"><bean id="jmsConnectionFactory" class="org.apache.qpid.jms.JmsConnectionFactory"> <property name="remoteURI" value="amqp://localhost:5672" /> <property name="username" value="admin"/> @@ -281,15 +281,15 @@ AMQPConnectionDetails amqpConnection() { </camelContext> </pre> -</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 conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</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 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: text; gutter: false; theme: Default" data-theme="Default">karaf@root()> repo-add camel karaf@root()> feature:install camel-amqp</pre> </div></div><p>and the environment would be set.</p><p>Use the <strong><code>camel-blueprint</code></strong> or <strong><code>camel-spring</code></strong> features to define routes in those contexts.</p><p> </p><p> </p><div class="conf-macro output-block" data-hasbody="false" data-macro-name="include"><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><p> </p><p> </p></div> <div class="conf-macro output-block" data-hasbody="false" data-macro-name="include"><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 conf-macro output-block" data-hasbody="true" data-macro-name="info"><p class="title">Prerequisites</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"> </span><div class="confluence-informati on-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 conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<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><p> </p><p> </p></div> <div class="conf-macro output-block" data-hasbody="false" data-macro-name="include"><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 conf-macro output-block" data-hasbody="true" data-macro-name="info"><p class="title">Prerequisites</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"> </span><div class="confluence-informati on-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 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">aws-sqs://queueName[?options] aws-sqs://queueNameOrArn[?options] (from Camel 2.18) </pre> -</div></div><p>The queue will be created if they don't already exists. You can append query options to the URI in the following format: <strong><code>?options=value&option2=value&...</code></strong></p><h3 id="BookComponentAppendix-URIOptions">URI Options</h3><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Context</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>accessKey</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Amazon AWS Access Key.</p></td></tr><tr><td colspan="1" rowspan="1" class="conflue nceTd"><p><code>amazonSQSClient</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference to a <strong><code>com.amazonaws.services.sqs.AmazonSQS</code></strong> in the <a shape="rect" href="registry.html">Registry</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>amazonSQSEndpoint</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The region with which the <strong><code>aws-sqs</code></strong> client wants to work with. Only works if Camel creates the <strong><code>aws-sqs</code></strong> client, i.e., if you explicitly set <strong><code>amazonSQSClient</code></strong>, then this setting will have no effect. You would have to set it on the client you create directly</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>attributeNames</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>Consumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A list of attribute names to receive when consuming. </p><p><strong>Camel 2.17:</strong> Multiple names can be separated by comma. </p><p><strong>Camel 2.16</strong> or older: The type is a Collection so its much harder to configure and use.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>concurrentConsumers</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>1</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>Consumer</code></td><td colspan="1" rowspan="1" class="confluenceTd">(<strong>as of 2.15.0</strong>) Allows you to use multiple threads to poll the SQS queue to increase throughput. You must also set t<span>he </span><strong><code>maxMessagesPerPoll</code></strong> option for this to work properly.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>defaultVisibilityTimeout</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The visibility timeout (in seconds) to set in the <strong><code>com.amazonaws.services.sqs.model.CreateQueueRequest</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>delaySeconds</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>Producer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9.3:</strong> Delay sending messages for a numb er of seconds.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>deleteAfterRead</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>Consumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Delete message from SQS after it has been read (and processed by the route).</p><p>If this option is false, then the same objects will be retrieve over and over again on the polls. Therefore you need to use the <a shape="rect" href="idempotent-consumer.html">Idempotent Consumer EIP</a> in the route to filter out duplicates. You can filter using the <strong><code>S3Constants#BUCKET_NAME</code></strong> and <strong><code>S3Constants#KEY</code></strong> headers, or only the <strong><code>S3Constants#KEY</code></strong> header.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>deleteIfFiltered</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>Consumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12.2, 2.13.0</strong>: Whether or not to send the <strong><code>DeleteMessage</code></strong> to the SQS queue if an exchange fails to get through a filter.</p><p>If <strong><code>false</code></strong> and exchange does not make it through a Camel filter upstream in the route, then don't send <strong><code>DeleteMessage</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>extendMessageVisibility</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Consumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> If enabled a scheduled background task will keep extending the message visib ility on SQS. This is needed if it takes a long time to process the message. If set to true<strong><code> visibilityTimeout</code></strong> must be set.</p><p>See details at <a shape="rect" class="external-link" href="http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QueryChangeMessageVisibility.html" rel="nofollow">Amazon docs</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maximumMessageSize</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8:</strong> The <strong><code>maximumMessageSize</code></strong> (in bytes) an SQS message can contain for this queue, to set in the <strong><code>com.amazonaws.services.sqs.model.SetQueueAttributesRequest</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">< p><code>maxMessagesPerPoll</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>Consumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The maximum number of messages which can be received in one poll to set in the <strong><code>com.amazonaws.services.sqs.model.ReceiveMessageRequest</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>messageAttributeNames</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>null</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>Consumer</code></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A list of message attribute names to receive when consuming. </p><p><strong>Camel 2.17:</strong><span> </span>Multiple names can be separated by comma. <span> </span></p><p><span><strong>Camel 2.16</strong> or older: The type is a Collection so its much harder to c onfigure and use.</span></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>messageRetentionPeriod</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8:</strong> The <strong><code>messageRetentionPeriod</code></strong> (in seconds) a message will be retained by SQS for this queue, to set in the <strong><code>com.amazonaws.services.sqs.model.SetQueueAttributesRequest</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>proxyHost</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>null</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>Shared</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.16</strong>: Specify a proxy host to be used inside the client definition.</td></tr ><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>proxyPort</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><code>null</code></td><td colspan="1" >rowspan="1" class="confluenceTd"><code>Shared</code></td><td colspan="1" >rowspan="1" class="confluenceTd"><strong>Camel 2.16</strong>: Specify a proxy >port to be used inside the client definition.</td></tr><tr><td colspan="1" >rowspan="1" >class="confluenceTd"><p><code>queueOwnerAWSAccountId</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>Shared</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> Specify the >queue owner aws account id when you need to connect the queue with different >account owner.</p></td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>policy</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p><code>null</code></p></t d><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8:</strong> The policy for this queue to set in the <strong><code>com.amazonaws.services.sqs.model.SetQueueAttributesRequest</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>receiveMessageWaitTimeSeconds</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11:</strong> If you do not specify <strong><code>WaitTimeSeconds</code></strong> in the request, the queue attribute <strong><code>ReceiveMessageWaitTimeSeconds</code></strong> is used to determine how long to wait.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>redrivePolicy</code></p></td><td colspan="1" rowspan="1" clas s="confluenceTd"><code>null</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>Shared</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.15</strong>: Specify the policy that send message to <strong><code>DeadLetter</code></strong> queue. See detail at <a shape="rect" class="external-link" href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues-redrivepolicy.html" rel="nofollow">Amazon docs</a>.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>region</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12.3:</strong> Specify the queue region which could be used with <strong><code>queueOwnerAWSAccountId</code></strong> to build the service URL.<br clear="none"><strong>Note</strong>: Region will st ill default to <strong><code>us-east-1</code></strong> if  <span><strong><code>queueOwnerAWSAccountId</code></strong> is not specified</span></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>secretKey</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Amazon AWS Secret Key.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>waitTimeSeconds</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>Producer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11:</strong> Duration in seconds (0 to 20) that the <strong><code>ReceiveMessage</code></strong> action call will wait until a message is in the queue to include in the respons e.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>visibilityTimeout</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a <strong><code>ReceiveMessage</code></strong> request. This only make sense if its different from <strong><code>defaultVisibilityTimeout</code></strong>.</p></td></tr></tbody></table></div><div class="confluence-information-macro confluence-information-macro-information conf-macro output-block" data-hasbody="true" data-macro-name="info"><p class="title">Required SQS component options</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"> </span><div class="confluence-information-macro-body"><p>You have to provide the <strong><code>amazonSQSClient</code></strong> in the <a shape="rect" href="registry.html">Registry</a> or your <strong><code>accessKey</code></strong> and <strong><code>secretKey</code></strong> to access the <a shape="rect" class="external-link" href="http://aws.amazon.com/sqs" rel="nofollow">Amazon's SQS</a>.</p></div></div><h3 id="BookComponentAppendix-BatchConsumer">Batch Consumer</h3><p>This component implements the <a shape="rect" href="batch-consumer.html">Batch Consumer</a>.</p><p>This allows you for instance to know how many messages exists in this batch and for instance let the <a shape="rect" href="aggregator.html">Aggregator</a> aggregate this number of messages.</p><h3 id="BookComponentAppendix-Usage.1">Usage</h3><h4 id="BookComponentAppendix-MessageheaderssetbytheSQSproducer">Message headers set by the SQS producer</h4><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Head er</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>CamelAwsSqsMD5OfBody</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The MD5 checksum of the Amazon SQS message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelAwsSqsMessageId</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Amazon SQS message ID.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelAwsSqsDelaySeconds</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Integer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Since <strong>Camel 2.11</strong>, the delay seconds that the Amazon SQS message can be see by others.</p></td></tr></tbody></table></div><h4 id="BookComponentAppendix-MessageheaderssetbytheSQSconsumer">Message headers set by the SQS consumer</h4><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>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>CamelAwsSqsMD5OfBody</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The MD5 checksum of the Amazon SQS message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelAwsSqsMessageId</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Amazon SQS message ID.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelAwsSqsReceiptHandle</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Amazon SQS message receipt handle.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelAwsSqsAttributes</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Map<String, String></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Amazon SQS message attributes.</p></td></tr></tbody></table></div><h4 id="BookComponentAppendix-AdvancedAmazonSQSconfiguration">Advanced AmazonSQS configuration</h4><p>If your Camel Application is running behind a firewall or if you need to have more control over the AmazonSQS instance configuration, you can create your own instance:</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>The queue will be created if they don't already exists. You can append query options to the URI in the following format: <strong><code>?options=value&option2=value&...</code></strong></p><h3 id="BookComponentAppendix-URIOptions">URI Options</h3><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Context</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>accessKey</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Amazon AWS Access Key.</p></td></tr><tr><td colspan="1" rowspan="1" class="conflue nceTd"><p><code>amazonSQSClient</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference to a <strong><code>com.amazonaws.services.sqs.AmazonSQS</code></strong> in the <a shape="rect" href="registry.html">Registry</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>amazonSQSEndpoint</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The region with which the <strong><code>aws-sqs</code></strong> client wants to work with. Only works if Camel creates the <strong><code>aws-sqs</code></strong> client, i.e., if you explicitly set <strong><code>amazonSQSClient</code></strong>, then this setting will have no effect. You would have to set it on the client you create directly</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>attributeNames</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>Consumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A list of attribute names to receive when consuming. </p><p><strong>Camel 2.17:</strong> Multiple names can be separated by comma. </p><p><strong>Camel 2.16</strong> or older: The type is a Collection so its much harder to configure and use.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>concurrentConsumers</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>1</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>Consumer</code></td><td colspan="1" rowspan="1" class="confluenceTd">(<strong>as of 2.15.0</strong>) Allows you to use multiple threads to poll the SQS queue to increase throughput. You must also set t<span>he </span><strong><code>maxMessagesPerPoll</code></strong> option for this to work properly.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>defaultVisibilityTimeout</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The visibility timeout (in seconds) to set in the <strong><code>com.amazonaws.services.sqs.model.CreateQueueRequest</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>delaySeconds</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>Producer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9.3:</strong> Delay sending messages for a numb er of seconds.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>deleteAfterRead</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>Consumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Delete message from SQS after it has been read (and processed by the route).</p><p>If this option is false, then the same objects will be retrieve over and over again on the polls. Therefore you need to use the <a shape="rect" href="idempotent-consumer.html">Idempotent Consumer EIP</a> in the route to filter out duplicates. You can filter using the <strong><code>S3Constants#BUCKET_NAME</code></strong> and <strong><code>S3Constants#KEY</code></strong> headers, or only the <strong><code>S3Constants#KEY</code></strong> header.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>deleteIfFiltered</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>Consumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12.2, 2.13.0</strong>: Whether or not to send the <strong><code>DeleteMessage</code></strong> to the SQS queue if an exchange fails to get through a filter.</p><p>If <strong><code>false</code></strong> and exchange does not make it through a Camel filter upstream in the route, then don't send <strong><code>DeleteMessage</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>extendMessageVisibility</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Consumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> If enabled a scheduled background task will keep extending the message visib ility on SQS. This is needed if it takes a long time to process the message. If set to true<strong><code> visibilityTimeout</code></strong> must be set.</p><p>See details at <a shape="rect" class="external-link" href="http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QueryChangeMessageVisibility.html" rel="nofollow">Amazon docs</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maximumMessageSize</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8:</strong> The <strong><code>maximumMessageSize</code></strong> (in bytes) an SQS message can contain for this queue, to set in the <strong><code>com.amazonaws.services.sqs.model.SetQueueAttributesRequest</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">< p><code>maxMessagesPerPoll</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>Consumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The maximum number of messages which can be received in one poll to set in the <strong><code>com.amazonaws.services.sqs.model.ReceiveMessageRequest</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>messageAttributeNames</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>null</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>Consumer</code></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A list of message attribute names to receive when consuming. </p><p><strong>Camel 2.17:</strong><span> </span>Multiple names can be separated by comma. <span> </span></p><p><span><strong>Camel 2.16</strong> or older: The type is a Collection so its much harder to c onfigure and use.</span></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>messageRetentionPeriod</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8:</strong> The <strong><code>messageRetentionPeriod</code></strong> (in seconds) a message will be retained by SQS for this queue, to set in the <strong><code>com.amazonaws.services.sqs.model.SetQueueAttributesRequest</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>proxyHost</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>null</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>Shared</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.16</strong>: Specify a proxy host to be used inside the client definition.</td></tr ><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>proxyPort</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><code>null</code></td><td colspan="1" >rowspan="1" class="confluenceTd"><code>Shared</code></td><td colspan="1" >rowspan="1" class="confluenceTd"><strong>Camel 2.16</strong>: Specify a proxy >port to be used inside the client definition.</td></tr><tr><td colspan="1" >rowspan="1" >class="confluenceTd"><p><code>queueOwnerAWSAccountId</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>Shared</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> Specify the >queue owner aws account id when you need to connect the queue with different >account owner.</p></td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>policy</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p><code>null</code></p></t d><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8:</strong> The policy for this queue to set in the <strong><code>com.amazonaws.services.sqs.model.SetQueueAttributesRequest</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>receiveMessageWaitTimeSeconds</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11:</strong> If you do not specify <strong><code>WaitTimeSeconds</code></strong> in the request, the queue attribute <strong><code>ReceiveMessageWaitTimeSeconds</code></strong> is used to determine how long to wait.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>redrivePolicy</code></p></td><td colspan="1" rowspan="1" clas s="confluenceTd"><code>null</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>Shared</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.15</strong>: Specify the policy that send message to <strong><code>DeadLetter</code></strong> queue. See detail at <a shape="rect" class="external-link" href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues-redrivepolicy.html" rel="nofollow">Amazon docs</a>.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>region</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12.3:</strong> Specify the queue region which could be used with <strong><code>queueOwnerAWSAccountId</code></strong> to build the service URL.<br clear="none"><strong>Note</strong>: Region will st ill default to <strong><code>us-east-1</code></strong> if  <span><strong><code>queueOwnerAWSAccountId</code></strong> is not specified</span></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>secretKey</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Amazon AWS Secret Key.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>waitTimeSeconds</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>Producer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11:</strong> Duration in seconds (0 to 20) that the <strong><code>ReceiveMessage</code></strong> action call will wait until a message is in the queue to include in the respons e.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>visibilityTimeout</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>Shared</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a <strong><code>ReceiveMessage</code></strong> request. This only make sense if its different from <strong><code>defaultVisibilityTimeout</code></strong>.</p></td></tr></tbody></table></div><div class="confluence-information-macro confluence-information-macro-information conf-macro output-block" data-hasbody="true" data-macro-name="info"><p class="title">Required SQS component options</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"> </span><div class="confluence-information-macro-body"><p>You have to provide the <strong><code>amazonSQSClient</code></strong> in the <a shape="rect" href="registry.html">Registry</a> or your <strong><code>accessKey</code></strong> and <strong><code>secretKey</code></strong> to access the <a shape="rect" class="external-link" href="http://aws.amazon.com/sqs" rel="nofollow">Amazon's SQS</a>.</p></div></div><h3 id="BookComponentAppendix-BatchConsumer">Batch Consumer</h3><p>This component implements the <a shape="rect" href="batch-consumer.html">Batch Consumer</a>.</p><p>This allows you for instance to know how many messages exists in this batch and for instance let the <a shape="rect" href="aggregator.html">Aggregator</a> aggregate this number of messages.</p><h3 id="BookComponentAppendix-Usage.1">Usage</h3><h4 id="BookComponentAppendix-MessageheaderssetbytheSQSproducer">Message headers set by the SQS producer</h4><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Head er</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>CamelAwsSqsMD5OfBody</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The MD5 checksum of the Amazon SQS message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelAwsSqsMessageId</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Amazon SQS message ID.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelAwsSqsDelaySeconds</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Integer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Since <strong>Camel 2.11</strong>, the delay seconds that the Amazon SQS message can be see by others.</p></td></tr></tbody></table></div><h4 id="BookComponentAppendix-MessageheaderssetbytheSQSconsumer">Message headers set by the SQS consumer</h4><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>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>CamelAwsSqsMD5OfBody</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The MD5 checksum of the Amazon SQS message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelAwsSqsMessageId</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Amazon SQS message ID.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelAwsSqsReceiptHandle</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Amazon SQS message receipt handle.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelAwsSqsAttributes</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Map<String, String></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Amazon SQS message attributes.</p></td></tr></tbody></table></div><h4 id="BookComponentAppendix-AdvancedAmazonSQSconfiguration">Advanced AmazonSQS configuration</h4><p>If your Camel Application is running behind a firewall or if you need to have more control over the AmazonSQS instance configuration, you can create your own instance:</p><div class="code panel pdl conf-macro output-block" style="border-width: 1px;" data-hasbo dy="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">AWSCredentials awsCredentials = new BasicAWSCredentials("myAccessKey", "mySecretKey"); ClientConfiguration clientConfiguration = new ClientConfiguration(); @@ -300,18 +300,18 @@ AmazonSQS client = new AmazonSQSClient(a registry.bind("client", client); </pre> -</div></div><p>and refer to it in your Camel aws-sqs component configuration:</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>and refer to it in your Camel aws-sqs component configuration:</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("aws-sqs://MyQueue?amazonSQSClient=#client&delay=5000&maxMessagesPerPoll=5") .to("mock:result"); </pre> -</div></div><h3 id="BookComponentAppendix-Dependencies">Dependencies</h3><p>Maven users will need to add the following dependency to their <strong><code>pom.xml</code></strong>.</p><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>pom.xml</b></div><div class="codeContent panelContent pdl"> +</div></div><h3 id="BookComponentAppendix-Dependencies">Dependencies</h3><p>Maven users will need to add the following dependency to their <strong><code>pom.xml</code></strong>.</p><div class="code panel pdl conf-macro output-block" style="border-width: 1px;" data-hasbody="true" data-macro-name="code"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>pom.xml</b></div><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-aws</artifactId> <version>${camel-version}</version> </dependency> </pre> -</div></div><p>where <strong><code>${camel-version</code>}</strong> must be replaced by the actual version of Camel (2.6 or higher).</p><h3 id="BookComponentAppendix-JMS-styleSelectors">JMS-style Selectors</h3><p>SQS does not allow selectors, but you can effectively achieve this by using the <a shape="rect" href="message-filter.html">Camel Filter EIP</a> and setting an appropriate <strong><code>visibilityTimeout</code></strong>. When SQS dispatches a message, it will wait up to the visibility timeout before it will try to dispatch the message to a different consumer unless a <strong><code>DeleteMessage</code></strong> is received. By default, Camel will always send the <strong><code>DeleteMessage</code></strong> at the end of the route, unless the route ended in failure. To achieve appropriate filtering and not send the <strong><code>DeleteMessage</code></strong> even on successful completion of the route, use a Filter:</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>where <strong><code>${camel-version</code>}</strong> must be replaced by the actual version of Camel (2.6 or higher).</p><h3 id="BookComponentAppendix-JMS-styleSelectors">JMS-style Selectors</h3><p>SQS does not allow selectors, but you can effectively achieve this by using the <a shape="rect" href="message-filter.html">Camel Filter EIP</a> and setting an appropriate <strong><code>visibilityTimeout</code></strong>. When SQS dispatches a message, it will wait up to the visibility timeout before it will try to dispatch the message to a different consumer unless a <strong><code>DeleteMessage</code></strong> is received. By default, Camel will always send the <strong><code>DeleteMessage</code></strong> at the end of the route, unless the route ended in failure. To achieve appropriate filtering and not send the <strong><code>DeleteMessage</code></strong> even on successful completion of the route, use a Filter:</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("aws-sqs://MyQueue?amazonSQSClient=#client&defaultVisibilityTimeout=5000&deleteIfFiltered=false") .filter("${header.login} == true") .to("mock:result"); @@ -325,30 +325,30 @@ registry.bind("client", client); </dependency> </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"> </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"> </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&option=value&...</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<Entry></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<Entry>)</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></div> <div class="conf-macro output-block" data-hasbody="false" data-macro-name="include"><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><p>bean:beanID[?options]</p><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">Regi stry</a></p><h3 id="BookComponentAppendix-Options.2">Options</h3><p>confluenceTableSmall</p><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"> </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> 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><p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p><h3 id="BookComponentAppendix-Using">Using</h3><p>Th e 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="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</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></div> <div class="conf-macro output-block" data-hasbody="false" data-macro-name="include"><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><p>bean:beanID[?options]</p><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">Regi stry</a></p><h3 id="BookComponentAppendix-Options.2">Options</h3><p>confluenceTableSmall</p><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"> </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> 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><p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p><h3 id="BookComponentAppendix-Using">Using</h3><p>Th e 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="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">// lets populate the context with the services we need // note that we could just use a spring.xml file to avoid this step JndiContext context = new JndiContext(); context.bind("bye", new SayService("Good Bye!")); CamelContext camelContext = new DefaultCamelContext(context);</pre> -</div></div><p>{snippet:id=register|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java}</p><p>Once an endpoint has been registered, you can build Camel routes that use it to process exchanges.</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>{snippet:id=register|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/component/pojo/PojoRouteTest.java}</p><p>Once an endpoint has been registered, you can build Camel routes that use it to process exchanges.</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">camelContext.addRoutes(new RouteBuilder() { public void configure() { from("direct:hello").to("bean:bye"); } });</pre> -</div></div><p>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><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 conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>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><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 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">Endpoint endpoint = camelContext.getEndpoint("direct:hello"); ISay proxy = PojoComponent.createProxy(endpoint, ISay.class); String rc = proxy.say(); assertEquals("Good Bye!", rc);</pre> -</div></div><p>And the same route using Spring DSL:</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>And the same route using Spring DSL:</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: xml; gutter: false; theme: Default" data-theme="Default"><route> <from uri="direct:hello"> <to uri="bean:bye"/> </route></pre> -</div></div><h3 id="BookComponentAppendix-Beanasendpoint"><br clear="none">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 conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h3 id="BookComponentAppendix-Beanasendpoint"><br clear="none">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 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: xml; gutter: false; theme: Default" data-theme="Default"><camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="direct:start"/> @@ -358,13 +358,13 @@ assertEquals("Good Bye!", rc);</pre> </camelContext> <bean id="myBean" class="org.apache.camel.spring.bind.ExampleBean"/></pre> -</div></div><p>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:</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>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:</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 ExampleBean { public String sayHello(String name) { return "Hello " + name + "!"; } }</pre> -</div></div><p>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><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>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><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">//Send message to the bean endpoint // and invoke method resolved using Bean Binding. from("direct:start").beanRef("beanName"); @@ -372,7 +372,7 @@ from("direct:start").beanRef("beanName") // Send message to the bean endpoint // and invoke given method. from("direct:start").beanRef("beanName", "methodName");</pre> -</div></div><p><br clear="none">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 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">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 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">// Send message to the given bean instance. from("direct:start").bean(new ExampleBean()); // Explicit selection of bean method to be invoked. @@ -386,7 +386,7 @@ from("direct:start").bean(ExampleBean.cl <h3 id="BookComponentAppendix-URIformat.4">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"> browse:someName[?options] </pre> @@ -396,7 +396,7 @@ browse:someName[?options] <h3 id="BookComponentAppendix-Sample">Sample</h3> <p>In the route below, we insert a <code>browse:</code> component to be able to browse the Exchanges that are passing through:</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("activemq:order.in").to("browse:orderReceived").to("bean:processOrder"); </pre> @@ -404,7 +404,7 @@ browse:someName[?options] <p>We can now inspect the received exchanges from within the Java 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"> private CamelContext context; @@ -423,7 +423,7 @@ browse:someName[?options] <div class="conf-macro output-block" data-hasbody="false" data-macro-name="include"><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></div></div> <div class="conf-macro output-block" data-hasbody="false" data-macro-name="include"><h2 id="BookComponentAppendix-CacheComponent">Cache Component</h2><div class="confluence-information-macro confluence-information-macro-warning conf-macro output-block" data-hasbody="true" data-macro-name="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 us ing 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 settings.</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 conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeContent panelContent pdl">
[... 2903 lines stripped ...]