Modified: websites/production/camel/content/sjms.html ============================================================================== --- websites/production/camel/content/sjms.html (original) +++ websites/production/camel/content/sjms.html Thu Sep 14 19:25:46 2017 @@ -86,7 +86,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="SJMS-SJMSComponent">SJMS Component</h2><p><strong>Available as of Camel 2.11</strong></p><p>The Simple JMS Component, or SJMS, is a JMS client for use with Camel that uses well known best practices when it comes to JMS client creation and configuration. SJMS contains a brand new JMS client API written explicitly for Camel eliminating third party messaging implementations keeping it light and resilient. The following features is included:</p><ul><li>Standard Queue and Topic Support (Durable & Non-Durable)</li><li>InOnly & InOut MEP Support</li><li>Asynchronous Producer and Consumer Processing</li><li>Internal JMS Transaction Support</li></ul><p>Additional key features include:</p><ul><li>Plugable Connection Resource Management</li><li>Session, Consumer, & Producer Pooling & Caching Management</li><li>Batch Consumers and Producers</li><li>Transacted Batch Consumers & Producers</li><li>Support for Customizable Transactio n Commit Strategies (Local JMS Transactions only)</li></ul><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Why the S in SJMS</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>S stands for Simple and Standard and Springless. Also camel-jms was already taken. <img class="emoticon emoticon-smile" src="https://cwiki.apache.org/confluence/s/en_GB/5997/6f42626d00e36f53fe51440403446ca61552e2a2.1/_/images/icons/emoticons/smile.png" data-emoticon-name="smile" alt="(smile)"></p></div></div><p> </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[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-sjms</artifactId> <version>x.x.x</version>
Modified: websites/production/camel/content/slack.html ============================================================================== --- websites/production/camel/content/slack.html (original) +++ websites/production/camel/content/slack.html Thu Sep 14 19:25:46 2017 @@ -86,7 +86,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="Slack-SlackComponent">Slack Component</h2><p><strong>Available as of Camel 2.16</strong></p><p><span>The </span><strong>slack</strong><span> component allows you to connect to an instance of </span><a shape="rect" class="external-link" href="http://www.slack.com/" rel="nofollow">Slack</a><span> and delivers a message contained in the message body via a pre established </span><a shape="rect" class="external-link" href="https://api.slack.com/incoming-webhooks" rel="nofollow">Slack incoming webhook</a><span>.</span></p><p>Maven users will need to add the following dependency to their <code style="line-height: 1.4285715;">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[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-slack</artifactId> <version>x.x.x</version> @@ -98,11 +98,11 @@ </div></div><p><span>To send a direct message to a slackuser.</span></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[slack:@username[?options]]]></script> </div></div><h3 id="Slack-Options">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>Description</p></th><th colspan="1" rowspan="1" class="confluenceTh">Example</th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span>username</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>This is the username that the bot will have when sending messages to a channel or user.</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><span>username=CamelUser</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><span>iconUrl</span></td><td colspan="1" rowspan="1" class="confluenceTd"><span>The avatar that the component will use when sending message to a channel or user.</span></td><td colspan="1" rowspan="1" class="confluenceTd"><span>iconUrl=<a shape="rect" class="external-link" href="http://some host.com/avatar.gif" rel="nofollow">http://somehost.com/avatar.gif</a></span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><span>iconEmoji</span></td><td colspan="1" rowspan="1" class="confluenceTd"><span>Use a Slack emoji as an avatar</span></td><td colspan="1" rowspan="1" class="confluenceTd"><span>iconEmoji=:camel:</span></td></tr></tbody></table></div><p> </p><h3 id="Slack-SlackComponent.1">SlackComponent</h3><p><span>The SlackComponent with XML must be configured as a Spring or Blueprint bean that contains the incoming webhook url for the integration as a parameter.</span></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[<bean id="slack" class="org.apache.camel.component.slack.SlackComponent"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<bean id="slack" class="org.apache.camel.component.slack.SlackComponent"> <property name="webhookUrl" value="https://hooks.slack.com/services/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"/> </bean>]]></script> </div></div><p> </p><p>For Java you can configure this using Java code.</p><h3 id="Slack-Example">Example</h3><p>A CamelContext with Blueprint could be as:</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[<?xml version="1.0" encoding="UTF-8"?> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy"> <bean id="slack" class="org.apache.camel.component.slack.SlackComponent"> Modified: websites/production/camel/content/smpp.html ============================================================================== --- websites/production/camel/content/smpp.html (original) +++ websites/production/camel/content/smpp.html Thu Sep 14 19:25:46 2017 @@ -86,7 +86,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="SMPP-SMPPComponent">SMPP Component</h2><p><strong>CamelSmppFinalStatusAvailable as of Camel 2.2</strong></p><p>This component provides access to an SMSC (Short Message Service Center) over the <a shape="rect" class="external-link" href="http://smsforum.net/SMPP_v3_4_Issue1_2.zip" rel="nofollow">SMPP</a> protocol to send and receive SMS. The <a shape="rect" class="external-link" href="http://jsmpp.org" rel="nofollow">JSMPP</a> library is used for the protocol implementation.</p><p>The Camel component currently operates as an <a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/ESME" rel="nofollow">ESME</a> (External Short Messaging Entity) and not as an SMSC itself.</p><p>The <a shape="rect" class="external-link" href="http://smsrouter.org" rel="nofollow">SMS Router</a> project provides an excellent example of an SMS Router daemon based on the Camel framework, routing messages between JMS queues (ActiveMQ) and the SMPP network.  Run multiple instances in parallel for high-availability.</p><p>Starting with<strong> Camel 2.9</strong> you are also able to execute ReplaceSm, QuerySm, SubmitMulti, CancelSm and DataSm.</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[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-smpp</artifactId> <version>x.x.x</version> @@ -129,7 +129,7 @@ smpps://[username@]hostname[:port][?opti password=password&enquireLinkTimer=3000&transactionTimer=5000&systemType=producer"); ]]></script> </div></div><p>A route which sends an SMS using the Spring XML DSL:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<route> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<route> <from uri="direct:start"/> <to uri="smpp://smppclient@localhost:2775? password=password&amp;enquireLinkTimer=3000&amp;transactionTimer=5000&amp;systemType=producer"/> @@ -140,7 +140,7 @@ smpps://[username@]hostname[:port][?opti .to("bean:foo"); ]]></script> </div></div><p>A route which receives an SMS using the Spring XML DSL:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="smpp://smppclient@localhost:2775? password=password&amp;enquireLinkTimer=3000&amp;transactionTimer=5000&amp;systemType=consumer"/> <to uri="bean:foo"/> Modified: websites/production/camel/content/snmp.html ============================================================================== --- websites/production/camel/content/snmp.html (original) +++ websites/production/camel/content/snmp.html Thu Sep 14 19:25:46 2017 @@ -86,7 +86,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="SNMP-SNMPComponent">SNMP Component</h2><p><strong>Available as of Camel 2.1</strong></p><p>The <strong>snmp:</strong> component gives you the ability to poll SNMP capable devices or receiving traps.</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[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-snmp</artifactId> <version>x.x.x</version> Modified: websites/production/camel/content/soap.html ============================================================================== --- websites/production/camel/content/soap.html (original) +++ websites/production/camel/content/soap.html Thu Sep 14 19:25:46 2017 @@ -134,7 +134,7 @@ from("direct:start") <p>When using XML DSL there is a version attribute you can set on the <soapjaxb> element.</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <!-- Defining a ServiceInterfaceStrategy for retrieving the element name when marshalling --> <bean id="myNameStrategy" class="org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy"> <constructor-arg value="com.example.customerservice.CustomerService"/> @@ -145,7 +145,7 @@ from("direct:start") <p>And in the Camel route</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="direct:start"/> <marshal> @@ -272,7 +272,7 @@ from("jms://queue:customerServiceQu <p>To use the SOAP dataformat in your camel routes you need to add the following dependency to your pom.</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-soap</artifactId> Modified: websites/production/camel/content/solr.html ============================================================================== --- websites/production/camel/content/solr.html (original) +++ websites/production/camel/content/solr.html Thu Sep 14 19:25:46 2017 @@ -86,7 +86,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="Solr-SolrComponent">Solr Component</h2><p><strong>Available as of Camel 2.9</strong></p><p>The Solr component allows you to interface with an <a shape="rect" class="external-link" href="http://lucene.apache.org/solr/">Apache Lucene Solr</a> server (based on SolrJ 3.5.0).</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[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-solr</artifactId> <version>x.x.x</version> @@ -113,7 +113,7 @@ from("direct:commit") .to("solr://localhost:8983/solr"); ]]></script> </div></div><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<route> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<route> <from uri="direct:insert"/> <setHeader headerName="SolrOperation"> <constant>INSERT</constant> Modified: websites/production/camel/content/sort.html ============================================================================== --- websites/production/camel/content/sort.html (original) +++ websites/production/camel/content/sort.html Thu Sep 14 19:25:46 2017 @@ -120,7 +120,7 @@ from("file://inbox").sort(body <p>In the route below it will read the file content and tokenize by line breaks so each line can be sorted. </p> <div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Camel 2.7 or better</b></div><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="file://inbox"/> <sort> @@ -132,7 +132,7 @@ from("file://inbox").sort(body </div></div> <div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Camel 2.6 or older</b></div><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="file://inbox"/> <sort> @@ -147,7 +147,7 @@ from("file://inbox").sort(body <p>And to use our own comparator we can refer to it as a spring bean:</p> <div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Camel 2.7 or better</b></div><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="file://inbox"/> <sort comparatorRef="myReverseComparator"> @@ -161,7 +161,7 @@ from("file://inbox").sort(body </div></div> <div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Camel 2.6 or older</b></div><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="file://inbox"/> <sort comparatorRef="myReverseComparator"> Modified: websites/production/camel/content/spark-rest.html ============================================================================== --- websites/production/camel/content/spark-rest.html (original) +++ websites/production/camel/content/spark-rest.html Thu Sep 14 19:25:46 2017 @@ -86,7 +86,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="Spark-rest-Spark-restComponent">Spark-rest Component</h2><p><strong>Available as of Camel 2.14</strong></p><p>The Spark-rest component allows to define REST endpoints using the <a shape="rect" class="external-link" href="http://sparkjava.com/" rel="nofollow">Spark REST Java library</a> (not to be mistaken with <a shape="rect" class="external-link" href="http://spark.apache.org/">Apache Spark</a>) using the <a shape="rect" href="rest-dsl.html">Rest DSL</a>.</p><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>This component integrates with Spark REST Java library which is a REST library. This is not related to <a shape="rect" class="external-link" href="http://spark.apache.org/">Apache Spark</a> which is a project about big data.</p><p>Apache Camel also pro vides a Camel component (<a shape="rect" href="apache-spark.html">camel-spark</a>) for integrating Camel with Apache Spark.</p></div></div><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">Spark REST Java Library requires Java 8 runtime.</div></div><p>Maven users will need to add the following dependency to their pom.xml 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[ <dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spark-rest</artifactId> <version>${camel-version}</version> @@ -122,7 +122,7 @@ </div> <div class="tabs-pane" id="RestDslTabsXml" data-pane-title="XML"> <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[ <camelContext xmlns="http://camel.apache.org/schema/spring"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <camelContext xmlns="http://camel.apache.org/schema/spring"> <rest uri="/hello/{me}"> <get> <route> Modified: websites/production/camel/content/spel.html ============================================================================== --- websites/production/camel/content/spel.html (original) +++ websites/production/camel/content/spel.html Thu Sep 14 19:25:46 2017 @@ -140,7 +140,7 @@ template.sendBodyAndHeader("direct: <p>You can use SpEL as an expression for <a shape="rect" href="recipient-list.html">Recipient List</a> or as a predicate inside a <a shape="rect" href="message-filter.html">Message Filter</a>:</p> <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="direct:foo"/> <filter> @@ -177,7 +177,7 @@ This is done using the following syntax: <p>You need Spring 3.0 or higher to use Spring Expression Language. If you use Maven you could just add the following to your <code>pom.xml</code>:</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring</artifactId> Modified: websites/production/camel/content/splunk.html ============================================================================== --- websites/production/camel/content/splunk.html (original) +++ websites/production/camel/content/splunk.html Thu Sep 14 19:25:46 2017 @@ -86,7 +86,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="Splunk-SplunkComponent">Splunk Component</h2><p><strong>Available as of Camel 2.13</strong></p><p>The Splunk component provides access to <a shape="rect" class="external-link" href="http://docs.splunk.com/Documentation/Splunk/latest" rel="nofollow">Splunk</a>, via the Splunk provided <a shape="rect" class="external-link" href="https://github.com/splunk/splunk-sdk-java" rel="nofollow">client</a> Rest API, allowing you to publish and search for events in Splunk.</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[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-splunk</artifactId> <version>${camel-version}</version> Modified: websites/production/camel/content/spring-boot.html ============================================================================== --- websites/production/camel/content/spring-boot.html (original) +++ websites/production/camel/content/spring-boot.html Thu Sep 14 19:25:46 2017 @@ -86,14 +86,14 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="SpringBoot-SpringBoot">Spring Boot</h2><p><strong>Available as of Camel 2.15</strong></p><p><span style="line-height: 1.4285715;">Spring Boot component provides auto-configuration for Apache Camel. Our opinionated auto-configuration of the Camel context auto-detects Camel routes available in the Spring context and registers the key Camel utilities (like producer template, consumer template and the type converter) as beans.</span></p><p><span style="line-height: 1.4285715;">Maven users will need to add the following dependency to their </span><strong><code style="line-height: 1.4285715;">pom.xml</code></strong><span style="line-height: 1.4285715;"> in order to use this component:</span></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring-boot</artifactId> <version>${camel.version}</version> <!-- use the same version as your Camel core version --> </dependency> ]]></script> </div></div><p><strong><code>camel-spring-boot</code></strong> jar comes with the <strong><code>spring.factories</code></strong> file, so as soon as you add that dependency into your classpath, Spring Boot will automatically auto-configure Camel for you.</p><h3 id="SpringBoot-CamelSpringBootStarter">Camel Spring Boot Starter</h3><p><strong>Available as of Camel 2.17</strong></p><p>Apache Camel ships a <a shape="rect" class="external-link" href="https://github.com/spring-projects/spring-boot/tree/master/spring-boot-starters" rel="nofollow">Spring Boot Starter</a> module that allows you to develop Spring Boot applications using starters. There is a <a shape="rect" class="external-link" href="https://github.com/apache/camel/tree/master/examples/camel-example-spring-boot-starter" rel="nofollow">sample application</a> in the source code also.</p><p>To use the starter, add the following to your spring boot <strong><code>pom.xml</code></strong> file:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring-boot-starter</artifactId> <version>2.17.0</version> @@ -151,9 +151,9 @@ public class MyRouterConfiguration { }Â }]]></script> </div></div><h3 id="SpringBoot-Camelproperties">Camel properties</h3><p>Spring Boot auto-configuration automatically connects to <a shape="rect" class="external-link" href="http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config" rel="nofollow">Spring Boot external configuration</a> (like properties placeholders, <span>OS environment variables or system properties) with the <a shape="rect" href="properties.html">Camel properties support</a>.</span> It basically means that any property defined in <strong><code>application.properties</code></strong> file:  </p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[route.from = jms:invoices]]></script> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[route.from = jms:invoices]]></script> </div></div><p>...or set via system property...</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[java -Droute.to=jms:processed.invoices -jar mySpringApp.jar]]></script> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[java -Droute.to=jms:processed.invoices -jar mySpringApp.jar]]></script> </div></div><p>...can be used as placeholders in Camel route:</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[@Component public class MyRouter extends RouteBuilder { @@ -181,7 +181,7 @@ public class MyAppConfig { } }]]></script> </div></div><p>Method <strong>C<code>amelContextConfiguration#</code><code><span style="line-height: 1.42857;">beforeApplicationStart(CamelContext)</span></code></strong><span style="line-height: 1.4285715;"> will be called just before the Spring context is started, so the <span><strong><code>CamelContext</code></strong> instance passed to this callback is fully</span> auto-configured. You can add many instances of <strong><code>CamelContextConfiguration</code></strong> into your Spring context - all of them will be executed.</span></p><h3 id="SpringBoot-DisablingJMX">Disabling JMX</h3><p>To disable JMX of the auto-configured <strong><code>CamelContext</code></strong> use <strong><code>camel.springboot.jmxEnabled</code></strong> property (JMX is enabled by default). For example you could add the following property to your <strong><code>application.properties</code></strong> file:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent pa nelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[camel.springboot.jmxEnabled = false]]></script> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[camel.springboot.jmxEnabled = false]]></script> </div></div><h3 id="SpringBoot-Auto-ConfiguredConsumerandProducerTemplates">Auto-Configured Consumer and Producer Templates</h3><p>Camel auto-configuration provides pre-configured <strong><code>ConsumerTemplate</code></strong> and <strong><code>ProducerTemplate</code></strong> instances. You can simply inject them into your Spring-managed beans:</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[@Component public class InvoiceProcessor { @@ -198,7 +198,7 @@ public class InvoiceProcessor { } }]]></script> </div></div><p>By default consumer templates and producer templates come with the endpoint cache sizes set to <strong><code>1000</code></strong>. You can change those values via the following Spring properties:</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[camel.springboot.consumerTemplateCacheSize = 100 +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[camel.springboot.consumerTemplateCacheSize = 100 camel.springboot.producerTemplateCacheSize = 200]]></script> </div></div><h3 id="SpringBoot-Auto-ConfiguredTypeConverter">Auto-Configured TypeConverter</h3><p>Camel auto-configuration registers a <strong><code>TypeConverter</code></strong> instance named <strong><code>typeConverter</code></strong> in the Spring context.</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[@Component @@ -225,7 +225,7 @@ public class InvoiceProcessor { } }]]></script> </div></div><p> </p><p>Under the hood Camel Spring Boot delegates conversion to the Spring's <code><a shape="rect" class="external-link" href="http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/core/convert/ConversionService.html" rel="nofollow">ConversionService</a></code> instances available in the application context. If no <strong><code>ConversionService</code></strong> instance is available, Camel Spring Boot auto-configuration will create one for you.</p><h3 id="SpringBoot-DisablingTypeConversionsFeatures">Disabling Type Conversions Features</h3><p>If you don't want Camel Spring Boot to register type-conversions related features (like <strong><code>TypeConverter</code></strong> instance or Spring bridge) set the <strong><code>camel.springboot.typeConversion</code></strong> property to <strong><code>false</code></strong>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[camel.springboot.typeConversion = false]]></script> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[camel.springboot.typeConversion = false]]></script> </div></div><h3 id="SpringBoot-FatJarsandFatWars">Fat Jars and Fat Wars</h3><p>The easiest way to create a Camel-aware Spring Boot fat jar/war is to extend the <strong><code><span style="line-height: 1.42857;">org</span><span style="line-height: 1.42857;">.apache.camel.spring.boot.F</span><code style="line-height: 1.4285715;">atJarRouter</code></code></strong><span style="line-height: 1.4285715;"> class:</span></p><p> </p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[package com.example; Â @@ -246,9 +246,9 @@ public class MyFatJarRouter extends FatJ } }]]></script> </div></div><p> </p><p>...and add the following property to your <strong><code>application.properties</code></strong> file:</p><p> </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[spring.main.sources = com.example.MyFatJarRouter]]></script> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[spring.main.sources = com.example.MyFatJarRouter]]></script> </div></div><p>It is also recommended to define your main class explicitly in the Spring Boot Maven plugin configuration: </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[ <plugin> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>${spring-boot.version}</version> @@ -288,7 +288,7 @@ camel.springboot.xmlRoutes = false // scan in the com/foo/routes classpath camel.springboot.xmlRoutes = classpath:com/foo/routes/*.xml]]></script> </div></div><p>The XML files should be Camel XML routes (not CamelContext) such as</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[ <routes xmlns="http://camel.apache.org/schema/spring"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <routes xmlns="http://camel.apache.org/schema/spring"> <route id="test"> <from uri="timer://trigger"/> <transform> @@ -303,7 +303,7 @@ camel.springboot.xmlRests = false // scan in the com/foo/routes classpath camel.springboot.xmlRests = classpath:com/foo/rests/*.xml]]></script> </div></div><p>The Rest-DSL XML files should be Camel XML rests (not CamelContext) such as</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[<rests xmlns="http://camel.apache.org/schema/spring"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<rests xmlns="http://camel.apache.org/schema/spring"> <rest> <post uri="/persons"> <to uri="direct:postPersons"/> Modified: websites/production/camel/content/spring-ldap.html ============================================================================== --- websites/production/camel/content/spring-ldap.html (original) +++ websites/production/camel/content/spring-ldap.html Thu Sep 14 19:25:46 2017 @@ -92,7 +92,7 @@ <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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring-ldap</artifactId> Modified: websites/production/camel/content/spring-neo4j.html ============================================================================== --- websites/production/camel/content/spring-neo4j.html (original) +++ websites/production/camel/content/spring-neo4j.html Thu Sep 14 19:25:46 2017 @@ -99,7 +99,7 @@ <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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring-neo4j</artifactId> Modified: websites/production/camel/content/spring-redis.html ============================================================================== --- websites/production/camel/content/spring-redis.html (original) +++ websites/production/camel/content/spring-redis.html Thu Sep 14 19:25:46 2017 @@ -95,7 +95,7 @@ <h3 id="SpringRedis-Dependencies">Dependencies</h3><p>Maven users will need to add the following dependency to their pom.xml.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>pom.xml</b></div><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring-redis</artifactId> <version>${camel-version}</version> Modified: websites/production/camel/content/spring-web-services.html ============================================================================== --- websites/production/camel/content/spring-web-services.html (original) +++ websites/production/camel/content/spring-web-services.html Thu Sep 14 19:25:46 2017 @@ -86,7 +86,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="SpringWebServices-SpringWebServicesComponent">Spring Web Services Component</h2><p><strong>Available as of Camel 2.6</strong></p><p>The <strong>spring-ws:</strong> component allows you to integrate with <a shape="rect" class="external-link" href="http://static.springsource.org/spring-ws/sites/1.5/" rel="nofollow">Spring Web Services</a>. It offers both <em>client</em>-side support, for accessing web services, and <em>server</em>-side support for creating your own contract-first web services.</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[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring-ws</artifactId> <version>x.x.x</version> @@ -183,7 +183,7 @@ protected void doProcessSoapAttachements .to("spring-ws:http://foo.com/bar?messageFactory=#messageFactory&messageSender=#messageSender") ]]></script> </div></div><p>Spring configuration:</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[<!-- authenticate using HTTP Basic Authentication --> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<!-- authenticate using HTTP Basic Authentication --> <bean id="messageSender" class="org.springframework.ws.transport.http.HttpComponentsMessageSender"> <property name="credentials"> <bean class="org.apache.commons.httpclient.UsernamePasswordCredentials"> @@ -201,7 +201,7 @@ protected void doProcessSoapAttachements </bean> ]]></script> </div></div><h2 id="SpringWebServices-Exposingwebservices">Exposing web services</h2><p>In order to expose a web service using this component you first need to set-up a <a shape="rect" class="external-link" href="http://static.springsource.org/spring-ws/sites/1.5/reference/html/server.html" rel="nofollow">MessageDispatcher</a> to look for endpoint mappings in a Spring XML file. If you plan on running inside a servlet container you probably want to use a <code>MessageDispatcherServlet</code> configured in <code>web.xml</code>.</p><p>By default the <code>MessageDispatcherServlet</code> will look for a Spring XML named <code>/WEB-INF/spring-ws-servlet.xml</code>. To use Camel with Spring-WS the only mandatory bean in that XML file is <code>CamelEndpointMapping</code>. This bean allows the <code>MessageDispatcher</code> to dispatch web service requests to your routes.</p><p><em>web.xml</em></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pd l"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<web-app> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<web-app> <servlet> <servlet-name>spring-ws</servlet-name> <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class> @@ -214,7 +214,7 @@ protected void doProcessSoapAttachements </web-app> ]]></script> </div></div><p><em>spring-ws-servlet.xml</em></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[<bean id="endpointMapping" class="org.apache.camel.component.spring.ws.bean.CamelEndpointMapping" /> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<bean id="endpointMapping" class="org.apache.camel.component.spring.ws.bean.CamelEndpointMapping" /> <bean id="wsdl" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition"> <property name="schema"> Modified: websites/production/camel/content/spring-ws-example.html ============================================================================== --- websites/production/camel/content/spring-ws-example.html (original) +++ websites/production/camel/content/spring-ws-example.html Thu Sep 14 19:25:46 2017 @@ -120,7 +120,7 @@ from("spring-ws:rootqname:{http://c <p>Further notice that the URI contains a reference to an <code>endpointMapping</code> in the <a shape="rect" href="registry.html">Registry</a>. Since we're using Spring the registry is a Spring ApplicationContext defined in <code>spring-ws-servlet.xml</code>. This file contains the following bean:</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <bean id="endpointMapping" class="org.apache.camel.component.spring.ws.bean.CamelEndpointMapping"> <property name="interceptors"> <list> @@ -136,7 +136,7 @@ from("spring-ws:rootqname:{http://c <p>The above <code>endpointMapping</code> bean is automatically picked up by the <code>MessageDispatcherServlet</code> declared in <code>web.xml</code>:</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <servlet> <servlet-name>spring-ws</servlet-name> <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class> Modified: websites/production/camel/content/springbatch.html ============================================================================== --- websites/production/camel/content/springbatch.html (original) +++ websites/production/camel/content/springbatch.html Thu Sep 14 19:25:46 2017 @@ -86,7 +86,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="SpringBatch-SpringBatchComponent">Spring Batch Component</h2><p>The <strong>spring-batch:</strong> component and support classes provide integration bridge between Camel and <a shape="rect" class="external-link" href="http://www.springsource.org/spring-batch" rel="nofollow">Spring Batch</a> infrastructure.</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[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring-batch</artifactId> <version>x.x.x</version> @@ -110,7 +110,7 @@ JobExecution jobExecution = mockEndpoint BatchStatus currentJobStatus = jobExecution.getStatus(); ]]></script> </div></div><h3 id="SpringBatch-Supportclasses">Support classes</h3><p>Apart from the Component, Camel Spring Batch provides also support classes, which can be used to hook into Spring Batch infrastructure.</p><h4 id="SpringBatch-CamelItemReader">CamelItemReader</h4><p><code>CamelItemReader</code> can be used to read batch data directly from the Camel infrastructure.</p><p>For example the snippet below configures Spring Batch to read data from JMS queue.</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[<bean id="camelReader" class="org.apache.camel.component.spring.batch.support.CamelItemReader"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<bean id="camelReader" class="org.apache.camel.component.spring.batch.support.CamelItemReader"> <constructor-arg ref="consumerTemplate"/> <constructor-arg value="jms:dataQueue"/> </bean> @@ -124,7 +124,7 @@ BatchStatus currentJobStatus = jobExecut </batch:job> ]]></script> </div></div><h4 id="SpringBatch-CamelItemWriter">CamelItemWriter</h4><p><code>CamelItemWriter</code> has similar purpose as <code>CamelItemReader</code>, but it is dedicated to write chunk of the processed data.</p><p>For example the snippet below configures Spring Batch to read data from JMS queue.</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[<bean id="camelwriter" class="org.apache.camel.component.spring.batch.support.CamelItemWriter"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<bean id="camelwriter" class="org.apache.camel.component.spring.batch.support.CamelItemWriter"> <constructor-arg ref="producerTemplate"/> <constructor-arg value="jms:dataQueue"/> </bean> @@ -138,7 +138,7 @@ BatchStatus currentJobStatus = jobExecut </batch:job> ]]></script> </div></div><h4 id="SpringBatch-CamelItemProcessor">CamelItemProcessor</h4><p><code>CamelItemProcessor</code> is the implementation of Spring Batch <code>org.springframework.batch.item.ItemProcessor</code> interface. The latter implementation relays on <a shape="rect" class="external-link" href="http://camel.apache.org/request-reply.html">Request Reply pattern</a> to delegate the processing of the batch item to the Camel infrastructure. The item to process is sent to the Camel endpoint as the body of the message.</p><p>For example the snippet below performs simple processing of the batch item using the <a shape="rect" class="external-link" href="http://camel.apache.org/direct.html">Direct endpoint </a> and the <a shape="rect" class="external-link" href="http://camel.apache.org/simple.html">Simple expression language </a>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camel:camelContext> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camel:camelContext> <camel:route> <camel:from uri="direct:processor"/> <camel:setExchangePattern pattern="InOut"/> @@ -162,7 +162,7 @@ BatchStatus currentJobStatus = jobExecut </batch:job> ]]></script> </div></div><h4 id="SpringBatch-CamelJobExecutionListener">CamelJobExecutionListener</h4><p><code>CamelJobExecutionListener</code> is the implementation of the <code>org.springframework.batch.core.JobExecutionListener</code> interface sending job execution events to the Camel endpoint.</p><p>The <code>org.springframework.batch.core.JobExecution</code> instance produced by the Spring Batch is sent as a body of the message. To distinguish between before- and after-callbacks <code>SPRING_BATCH_JOB_EVENT_TYPE</code> header is set to the <code>BEFORE</code> or <code>AFTER</code> value.</p><p>The example snippet below sends Spring Batch job execution events to the JMS queue.</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[<bean id="camelJobExecutionListener" class="org.apache.camel.component.spring.batch.support.CamelJobExecutionListener"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<bean id="camelJobExecutionListener" class="org.apache.camel.component.spring.batch.support.CamelJobExecutionListener"> <constructor-arg ref="producerTemplate"/> <constructor-arg value="jms:batchEventsBus"/> </bean> Modified: websites/production/camel/content/sql-stored-procedure.html ============================================================================== --- websites/production/camel/content/sql-stored-procedure.html (original) +++ websites/production/camel/content/sql-stored-procedure.html Thu Sep 14 19:25:46 2017 @@ -86,7 +86,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="SQLStoredProcedure-SQLStoredProcedureComponent">SQL Stored Procedure Component</h2><p><strong>Available as of Camel 2.17</strong></p><p>The <strong>sql-stored:</strong> component allows you to work with databases using JDBC Stored Procedure queries. This component is an extension to the <a shape="rect" href="sql-component.html">SQL Component</a> but specialized for calling stored procedures.</p><p>This component uses <code><strong>spring-jdbc</strong></code> behind the scenes for the actual SQL handling.</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[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-sql</artifactId> <version>x.x.x</version> Modified: websites/production/camel/content/sql.html ============================================================================== --- websites/production/camel/content/sql.html (original) +++ websites/production/camel/content/sql.html Thu Sep 14 19:25:46 2017 @@ -86,7 +86,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="SQL-SQLLanguage">SQL Language</h2><p>The SQL support is added by <a shape="rect" class="external-link" href="http://josql.sourceforge.net/" rel="nofollow">JoSQL</a> and is primarily used for performing SQL queries on in-memory objects. If you prefer to perform actual database queries then check out the <a shape="rect" href="jpa.html">JPA</a> component.</p><div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Looking for the SQL component</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Camel has both a <a shape="rect" href="sql.html">SQL</a> language and a <a shape="rect" href="sql-component.html">SQL Component</a>. This page is about the SQL language. Click on <a shape="rect" href="sql-component.html">SQL Component</a> if you are looking for the component instead.</p></div></div><p>To use SQL in y our camel routes you need to add the a dependency on <strong>camel-josql</strong> which implements the SQL language.</p><p>If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-josql</artifactId> <version>x.x.x</version> @@ -97,7 +97,7 @@ <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from("queue:foo").setBody().sql("select * from MyType").to("queue:bar") ]]></script> </div></div><p>And the spring DSL:</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[ <from uri="queue:foo"/> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <from uri="queue:foo"/> <setBody> <sql>select * from MyType</sql> </setBody> Modified: websites/production/camel/content/ssh.html ============================================================================== --- websites/production/camel/content/ssh.html (original) +++ websites/production/camel/content/ssh.html Thu Sep 14 19:25:46 2017 @@ -93,7 +93,7 @@ <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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-ssh</artifactId> @@ -134,7 +134,7 @@ ssh:[username[:password]@]host[:port][?o <p>Here is an example of this within the XML DSL. Note that the command has an XML encoded newline (<code>&#10;</code>).</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route id="camel-example-ssh-producer"> <from uri="direct:exampleSshProducer"/> <setBody> @@ -157,7 +157,7 @@ ssh:[username[:password]@]host[:port][?o <p>In the XML DSL,</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route> <from uri="ssh://scott@localhost:8101?certResource=classpath:test_rsa&amp;useFixedDelay=true&amp;delay=5000&amp;pollCommand=features:list%0A"/> <log message="${body}"/> @@ -180,7 +180,7 @@ from("ssh://scott@localhost:8101?ce <p>You will need to add some additional runtime dependencies if you use certificate based authentication. The dependency versions shown are as of Camel 2.11, you may need to use later versions depending what version of Camel you are using.</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <dependency> <groupId>org.apache.sshd</groupId> <artifactId>sshd-core</artifactId> Modified: websites/production/camel/content/stax.html ============================================================================== --- websites/production/camel/content/stax.html (original) +++ websites/production/camel/content/stax.html Thu Sep 14 19:25:46 2017 @@ -94,7 +94,7 @@ Another feature of this component is to <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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-stax</artifactId> @@ -219,7 +219,7 @@ public class Record { <p>Then you get a XML file to process:</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <records> <record value="v0" key="0"/> Modified: websites/production/camel/content/stomp.html ============================================================================== --- websites/production/camel/content/stomp.html (original) +++ websites/production/camel/content/stomp.html Thu Sep 14 19:25:46 2017 @@ -86,7 +86,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="Stomp-StompComponent">Stomp Component</h2><p><strong>Available as of Camel 2.12</strong></p><p>The <strong>stomp:</strong> component is used for communicating with <a shape="rect" class="external-link" href="http://stomp.github.io/" rel="nofollow">Stomp</a> compliant message brokers, like <a shape="rect" class="external-link" href="http://activemq.apache.org">Apache ActiveMQ</a> or <a shape="rect" class="external-link" href="http://activemq.apache.org/apollo/">ActiveMQ Apollo</a></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[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-stomp</artifactId> <version>x.x.x</version> Modified: websites/production/camel/content/stream-caching.html ============================================================================== --- websites/production/camel/content/stream-caching.html (original) +++ websites/production/camel/content/stream-caching.html Thu Sep 14 19:25:46 2017 @@ -115,7 +115,7 @@ from("jbi:service:http://foo.bar.or <p>In Spring XML you enable it by setting the <code>streamCache="true"</code> attribute on the <code>route</code> tag.</p> <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route streamCache="true"> <from uri="jbi:service:http://foo.bar.org/MyService"/> <to uri="jbi:service:http://foo.bar.org/MyOtherService"/> @@ -126,7 +126,7 @@ from("jbi:service:http://foo.bar.or <h3 id="Streamcaching-Scopes">Scopes</h3> <p>StreamCache supports the global and per route scope. So by setting the streamCache attribute on camelContext you can enable/disable it globally.</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <camelContext streamCache="true"> ... </camelContext> @@ -135,7 +135,7 @@ from("jbi:service:http://foo.bar.or <p>The route scope is configured by the <code>streamCache</code> attribute on the <code><route></code> tag such as:</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <route streamCache="true"> <from uri="jbi:service:http://foo.bar.org/MyService"/> <to uri="jbi:service:http://foo.bar.org/MyOtherService"/> @@ -145,7 +145,7 @@ from("jbi:service:http://foo.bar.or <p>You can mix and match for instance you can enable it globally and disable it on a particular route such as:</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <camelContext streamCache="true"> <route> <from uri="jbi:service:http://foo.bar.org/MyService"/> @@ -177,7 +177,7 @@ from("jbi:service:http://foo.bar.or <p><strong>Spring DSL:</strong></p> <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <camelContext streamCache="true"> <route streamCache="false"> <from uri="jetty:http://0.0.0.0:9090"/> @@ -218,7 +218,7 @@ context.getProperties().put(CachedOutput <p>And in XML you do</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <camelContext xmlns="http://camel.apache.org/schema/blueprint"> <!-- disable stream caching spool to disk --> @@ -242,7 +242,7 @@ context.getProperties().put(CachedOutput <p>And in XML you do</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <camelContext xmlns="http://camel.apache.org/schema/blueprint"> <!-- disable stream caching spool to disk --> @@ -310,7 +310,7 @@ context.setStreamCaching(true); <p>And in XML you do:</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <camelContext streamCache="true" xmlns="http://camel.apache.org/schema/blueprint"> <streamCaching id="myCacheConfig" bufferSize="16384" spoolDirectory="/tmp/cachedir" spoolThreshold="65536"/> @@ -328,7 +328,7 @@ context.setStreamCaching(true); <p>And in XML you do</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <!-- define a bean of type StreamCachingStrategy which CamelContext will automatic use --> <bean id="streamStrategy" class="org.apache.camel.impl.DefaultStreamCachingStrategy"> <property name="spoolDirectory" value="/tmp/cachedir"/> @@ -400,7 +400,7 @@ context.setStreamCaching(true); <p>And from XML you need to define a <bean> with your custom rule</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <bean id="mySpoolRule" class="com.foo.MySpoolRule"/> <streamCaching id="myCacheConfig" spoolDirectory="/tmp/cachedir" spoolRules="mySpoolRule"/> @@ -409,7 +409,7 @@ context.setStreamCaching(true); <p>Using the <code>spoolRules</code> attribute on <streamCaching>. if you have more rules, then separate them by comma.</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[ +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <streamCaching id="myCacheConfig" spoolDirectory="/tmp/cachedir" spoolRules="mySpoolRule,myOtherSpoolRule"/> ]]></script> </div></div> Modified: websites/production/camel/content/syslog.html ============================================================================== --- websites/production/camel/content/syslog.html (original) +++ websites/production/camel/content/syslog.html Thu Sep 14 19:25:46 2017 @@ -85,7 +85,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="Syslog-SyslogDataFormat">Syslog DataFormat</h2><p><strong>Available as of Camel 2.6</strong></p><p>The <strong>syslog</strong> dataformat is used for working with <a shape="rect" class="external-link" href="http://www.ietf.org/rfc/rfc3164.txt" rel="nofollow">RFC3164</a> and RFC5424 messages.</p><p>This component supports the following:</p><ul class="alternate"><li>UDP consumption of syslog messages</li><li>Agnostic data format using either plain String objects or SyslogMessage model objects.</li><li><a shape="rect" href="type-converter.html">Type Converter</a> from/to SyslogMessage and String</li><li>Integration with the <a shape="rect" href="mina.html">camel-mina</a> component.</li><li>Integration with the <a shape="rect" href="netty.html">camel-netty</a> component.</li><li><strong>Camel 2.14:</strong> Encoder and decoder for the <a shape="rect" href="netty.html">camel-netty</a> component.</li><li><strong>Camel 2.14:</str ong> Support for RFC5424 also.</li></ul><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[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-syslog</artifactId> <version>x.x.x</version> @@ -93,7 +93,7 @@ </dependency> ]]></script> </div></div><h3 id="Syslog-RFC3164Syslogprotocol">RFC3164 Syslog protocol</h3><p>Syslog uses the user datagram protocol (UDP) <a shape="rect" class="unresolved" href="#">1</a> as its underlying transport layer mechanism. <br clear="none"> The UDP port that has been assigned to syslog is 514.</p><p>To expose a Syslog listener service we reuse the existing <a shape="rect" href="mina.html">camel-mina</a> component or <a shape="rect" href="netty.html">camel-netty</a> where we just use the <code>Rfc3164SyslogDataFormat</code> to marshal and unmarshal messages. Notice that from <strong>Camel 2.14</strong> onwards the syslog dataformat is renamed to <code>SyslogDataFormat</code>.</p><h3 id="Syslog-RFC5424Syslogprotocol">RFC5424 Syslog protocol</h3><p><strong>Available as of Camel 2.14</strong></p><p>To expose a Syslog listener service we reuse the existing <a shape="rect" href="mina.html">camel-mina</a> component or <a shape="rect" href="netty.html">camel-netty</a>  ;where we just use the <code>SyslogDataFormat</code> to marshal and unmarshal messages</p><h4 id="Syslog-ExposingaSysloglistener">Exposing a Syslog listener</h4><p>In our Spring XML file, we configure an endpoint to listen for udp messages on port 10514, note that in netty we disable the defaultCodec, this <br clear="none"> will allow a fallback to a NettyTypeConverter and delivers the message as an InputStream:</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[<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring"> <dataFormats> <syslog id="mySyslog"/> @@ -108,7 +108,7 @@ </camelContext> ]]></script> </div></div><p>The same route using <a shape="rect" href="mina.html">camel-mina</a></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring"> <dataFormats> <syslog id="mySyslog"/> @@ -123,7 +123,7 @@ </camelContext> ]]></script> </div></div><h4 id="Syslog-Sendingsyslogmessagestoaremotedestination">Sending syslog messages to a remote destination</h4><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[<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring"> <dataFormats> <syslog id="mySyslog"/> Modified: websites/production/camel/content/tar-dataformat.html ============================================================================== --- websites/production/camel/content/tar-dataformat.html (original) +++ websites/production/camel/content/tar-dataformat.html Thu Sep 14 19:25:46 2017 @@ -124,7 +124,7 @@ .setHeader(Exchange.FILE_NAME, constant("reports.tar")) .to("file:output/directory");]]></script> </div></div><p> </p></div><h4 id="TarDataFormat-Dependencies">Dependencies</h4><div><p>To use Tar Files in your camel routes you need to add a dependency on <span>camel-tarfile</span> which implements this data format.</p></div><div><p>If you use Maven you can just add the following to your <code>pom.xml</code>, substituting the version number for the latest & greatest release (see <a shape="rect" class="external-link" href="https://github.com/apache/camel/blob/master/components/camel-tarfile/src/main/docs/download.html" rel="nofollow">the download page for the latest versions</a>).</p></div></div><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-tarfile</artifactId> <version>x.x.x</version> Modified: websites/production/camel/content/test.html ============================================================================== --- websites/production/camel/content/test.html (original) +++ websites/production/camel/content/test.html Thu Sep 14 19:25:46 2017 @@ -86,7 +86,7 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="Test-TestComponent">Test Component</h2><p><a shape="rect" href="testing.html">Testing</a> of distributed and asynchronous processing is notoriously difficult. The <a shape="rect" href="mock.html">Mock</a>, <a shape="rect" href="test.html">Test</a> and <a shape="rect" href="dataset.html">DataSet</a> endpoints work great with the <a shape="rect" href="testing.html">Camel Testing Framework</a> to simplify your unit and integration testing using <a shape="rect" href="enterprise-integration-patterns.html">Enterprise Integration Patterns</a> and Camel's large range of <a shape="rect" href="components.html">Components</a> together with the powerful <a shape="rect" href="bean-integration.html">Bean Integration</a>.</p><p>The <strong><code>test</code></strong> component extends the <a shape="rect" href="mock.html">Mock</a> component to support pulling messages from another endpoint on startup to set the expected message bodies on the underlying < a shape="rect" href="mock.html">Mock</a> endpoint. That is, you use the test endpoint in a route and messages arriving on it will be implicitly compared to some expected messages extracted from some other location.</p><p>So you can use, for example, an expected set of message bodies as files. This will then set up a properly configured <a shape="rect" href="mock.html">Mock</a> endpoint, which is only valid if the received messages match the number of expected messages and their message payloads are equal.</p><p>Maven users will need to add the following dependency to their <strong><code>pom.xml</code></strong> for this component when using <strong>Camel 2.8</strong> or older:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring</artifactId> <version>x.x.x</version> Modified: websites/production/camel/content/threading-model.html ============================================================================== --- websites/production/camel/content/threading-model.html (original) +++ websites/production/camel/content/threading-model.html Thu Sep 14 19:25:46 2017 @@ -85,12 +85,12 @@ <tr> <td valign="top" width="100%"> <div class="wiki-content maincontent"><h2 id="ThreadingModel-ThreadingModel">Threading Model</h2><p><strong>Available as of Camel 2.3</strong></p><p>The threading model in Camel is based on leveraging the JDK concurrency API which provides thread pools, named <code>ExecutorService</code>.</p><p>Camel leverages thread pools in the following places:</p><ul class="alternate"><li>several <a shape="rect" href="eip.html">EIP</a> patterns supports using thread pools for concurrency</li><li><a shape="rect" href="seda.html">SEDA</a> component for asynchronous connectivity</li><li><a shape="rect" href="async.html">Threads DSL</a> in the Camel route</li><li><a shape="rect" href="servicepool.html">ServicePool</a> for pooling services</li><li>And some component provide thread pools by nature such as <a shape="rect" href="jms.html">JMS</a>, <a shape="rect" href="jetty.html">Jetty</a></li></ul><h3 id="ThreadingModel-Threadpoolprofiles">Thread pool profiles</h3><p>By default when a thread pool is t o be created then its based on the default thread pool profile which is:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <threadPoolProfile id="defaultThreadPoolProfile" defaultProfile="true" +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <threadPoolProfile id="defaultThreadPoolProfile" defaultProfile="true" poolSize="10" maxPoolSize="20" maxQueueSize="1000" allowCoreThreadTimeOut="false" rejectedPolicy="CallerRuns"/> ]]></script> </div></div><p>What that means is that for example when you use <a shape="rect" href="multicast.html">Multicast</a> with <code>parallelProcessing=true</code> enabled, then it would create a thread pool based on the profile above. The <code>rejectedPolicy</code> has four options: <code>Abort, CallerRuns, Discard, DiscardOldest</code> which corresponds to the same four options provided out of the box in the JDK. <strong>Notice:</strong> option allowCoreThreadTimeOut is a new option from <strong>Camel 2.15</strong> onwards.</p><p>You can define as many thread pool profiles as you like. But there must only <strong>one</strong> default profile. A custom thread pool profile will inherit from the default profile. Which means that any option you do not explicit define will fallback and use the option from the default profile.</p><p>You can use <code>-1</code> in maxQueueSize to indicate a unbounded queue.</p><p>In Java DSL you can configure the default thread pool profile from the <code>ExecutorServiceStrategy</code>/<code>ExecutorServiceManager</code> which you access from <code>CamelContext</code>.</p><h3 id="ThreadingModel-Usingthreadpoolprofiles">Using thread pool profiles</h3><p>Suppose you want to use a custom thread pool profile for a Multicast EIP pattern in a Camel route you can do it using the <code>executorServiceRef</code> attribute as shown:</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[<camelContext ...> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext ...> ... <threadPoolProfile id="fooProfile" poolSize="20" maxPoolSize="50" maxQueueSize="-1"/> @@ -106,7 +106,7 @@ </camelContext> ]]></script> </div></div><p>What Camel will do at runtime is to lookup in the <a shape="rect" href="registry.html">Registry</a> for a <code>ExecutorService</code> with the id = fooProfile. If none found it will fallback and see if there is a <code>ThreadPoolProfile</code> defined with that id. And in this example there is and so the profile is used for creating a new <code>ExecutorService</code> which is handed back to the <a shape="rect" href="multicast.html">Multicast</a> EIP to use in the route.</p><h3 id="ThreadingModel-Createcustomthreadpool">Create custom thread pool</h3><p>You can also use the <threadPool/> tag in Spring XML to create a specific thread pool (eg <code>ExecutorService</code>). Notice that any options you do not explicit define, will have Camel to use the default thread pool profile as fallback. For example if you omit setting the <code>maxQueueSize</code> then Camel will fallback and use the value from the default thread pool profiles, which by default is 1000.</p><h3 id="ThreadingModel-Management">Management</h3><p>All the thread pools that Camel creates are managed and thus you can see them in JConsole under the <code>threadpools</code> category.</p><h3 id="ThreadingModel-ExecutorServiceStrategy">ExecutorServiceStrategy</h3><p><strong>Available as of Camel 2.3 to 2.8.x</strong><br clear="none"> Camel provides a pluggable strategy to hook in your own thread pool provider, for example from a WorkManager in a J2EE server etc.<br clear="none"> See the <code>org.apache.camel.spi.ExecutorServiceStrategy</code> interface which you should implement and hook into the WorkManager.</p><p>See <a shape="rect" href="advanced-configuration-of-camelcontext-using-spring.html">Advanced configuration of CamelContext using Spring</a> for how to configure it.</p><p>You can configure it on the <code>CamelContext</code> from Java DSL using the getter/setter.</p><h3 id="ThreadingModel-ExecutorServiceManager">ExecutorServiceManager</h3><p><strong>Available as of Camel 2.9</strong></p><p>In camel 2.9.0 the <code>ExecutorServiceManager</code> replaces the <code>ExecutorServiceStrategy</code>. It is renamed to manager as is not only provides a strategy for thread pool creation but also keeps track of thread pools and thread pool profiles.</p><p>To hook in custom thread pool providers (e.g. for J2EE servers) a <code>ThreadPoolFactory</code> interface can be implemented. The implementation can be set in the <code>ExecutorServiceManager</code>. The Factory interface is much simpler then the former <code>ExecutorServiceStrategy</code> and makes the job of integrators much easier.</p><p>See <a shape="rect" href="advanced-configuration-of-camelcontext-using-spring.html">Advanced configuration of CamelContext using Spring</a> for how to configure it.</p><h3 id="ThreadingModel-Customizingthreadnames">Customizing thread names</h3><p>On the <code>ExecutorServiceStrategy</code>/<code>ExecutorServiceManager</code> you can configure the thread name pattern usin g the <code>setThreadNamePattern</code> method, which defines the thread names used when a thread pool creates a thread.</p><p>The default pattern is for:</p><ul class="alternate"><li><strong>Camel 2.9.x or older:</strong> <code>Camel (${camelId}) thread #${counter} - ${name</code>}</li><li><strong>Camel 2.10 onwards:</strong> <code>Camel (#camelId#) thread ##counter# - #name#</code></li></ul><p>Notice we renamed the tokens from Camel 2.10 onwards to not clash with tokens by the <a shape="rect" href="using-propertyplaceholder.html">Property Placeholder</a>.</p><p>In the pattern you can use the following placeholders</p><ul class="alternate"><li>${camelId} <strong>Camel 2.6:</strong> is the <a shape="rect" href="camelcontext.html">CamelContext</a> name</li><li>${counter} is a unique incrementing counter.</li><li>${name} is the regular thread name.</li><li>${longName} is the long thread name which can includes endpoint parameters etc.</li></ul><p>Notice the pattern name has changed fr om Camel 2.10 onwards, use #name# instead.</p><p>In Camel 2.11 onwards its easier to set the thread name pattern on the CamelContext using the threadNamePattern attribute in the XML files as shown 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[ <camelContext xmlns="http://camel.apache.org/schema/spring" threadNamePattern="Riding the thread #counter#"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ <camelContext xmlns="http://camel.apache.org/schema/spring" threadNamePattern="Riding the thread #counter#"> <route> <from uri="seda:start"/> <to uri="log:result"/>