camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r847004 - in /websites/production/camel/content: book-component-appendix.html camel-2110-release.html sql-component.html
Date Thu, 17 Jan 2013 14:25:24 GMT
Author: buildbot
Date: Thu Jan 17 14:25:23 2013
New Revision: 847004

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/book-component-appendix.html
    websites/production/camel/content/camel-2110-release.html
    websites/production/camel/content/sql-component.html

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 Thu Jan 17 14:25:23 2013
@@ -16292,6 +16292,19 @@ sql:select * from table where id=# order
 </pre>
 </div></div>
 
+<p>From Camel 2.11 onwards you can use named parameters by using <tt>#:name</tt> style as shown:  </p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+sql:select * from table where id=#:myId order by name[?options]
+</pre>
+</div></div>
+
+<p>When using named parameters, Camel will lookup the names from, in the given precedence:<br clear="none">
+1. from message body if its a <tt>java.util.Map</tt><br clear="none">
+2. from message headers</p>
+
+<p>If a named parameter cannot be resolved, then an exception is thrown.</p>
+
 <p>Notice that the standard <tt>?</tt> symbol that denotes the parameters to an SQL query is substituted with the <tt>#</tt> symbol, because the <tt>?</tt> symbol is used to specify options for the endpoint. The <tt>?</tt> symbol replacement can be configured on endpoint basis.</p>
 
 <p>You can append query options to the URI in the following format, <tt>?option=value&amp;option=value&amp;...</tt></p>
@@ -16299,7 +16312,7 @@ sql:select * from table where id=# order
 <h3><a shape="rect" name="BookComponentAppendix-Options"></a>Options</h3>
 
 <div class="confluenceTableSmall"><div class="table-wrap">
-<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Option </th><th colspan="1" rowspan="1" class="confluenceTh"> Type </th><th colspan="1" rowspan="1" class="confluenceTh"> Default </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>batch</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.7.5, 2.8.4 and 2.9:</b> Execute SQL batch update statements. See notes below on how the treatment of the inbound message body changes if this is set to <tt>true</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>dataSourceRef</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1
 " rowspan="1" class="confluenceTd"> Reference to a <tt>DataSource</tt> to look up in the registry. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>placeholder</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>#</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.4:</b> Specifies a character that will be replaced to <tt>?</tt> in SQL query. Notice, that it is simple <tt>String.replaceAll()</tt> operation and no SQL parsing is involved (quoted strings will also change) </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>template.&lt;xxx&gt;</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Sets additional options on the Spring <tt>JdbcTemplate</tt> that is used behind the scenes to execute the queries. 
 For instance, <tt>template.maxRows=10</tt>. For detailed documentation, see the <a shape="rect" class="external-link" href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/jdbc/core/JdbcTemplate.html" rel="nofollow">JdbcTemplate javadoc</a> documentation. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.delay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>long</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>500</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Delay in milliseconds between each poll. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.initialDelay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>long</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>1000</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Millis
 econds before polling starts. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.useFixedDelay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Set to <tt>true</tt> to use fixed delay between polls, 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. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>maxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>int</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>0</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> An int
 eger value to define the maximum number of messages to gather per poll. By default, no maximum is set. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.useIterator</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> If <tt>true</tt> each row returned when polling will be processed individually. If <tt>false</tt> the entire <tt>java.util.List</tt> of data is set as the IN body. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.routeEmptyResultSet</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Whether to route a single empty <a shape="r
 ect" href="exchange.html" title="Exchange">Exchange</a> if there was no data to poll. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.expectedUpdateCount</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>int</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>-1</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> If using <tt>consumer.onConsume</tt> then this option can be used to set an expected number of rows being updated. Typically you may set this to <tt>1</tt> to expect one row to be updated. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.breakBatchOnConsumeFail</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">  <b>Camel 2.11:</b> <b>SQL consumer only:</b> If using <tt>consumer.onCons
 ume</tt> and it fails, then this option controls whether to break out of the batch or continue processing the next row from the batch. </td></tr></tbody></table>
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Option </th><th colspan="1" rowspan="1" class="confluenceTh"> Type </th><th colspan="1" rowspan="1" class="confluenceTh"> Default </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>batch</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.7.5, 2.8.4 and 2.9:</b> Execute SQL batch update statements. See notes below on how the treatment of the inbound message body changes if this is set to <tt>true</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>dataSourceRef</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1
 " rowspan="1" class="confluenceTd"> Reference to a <tt>DataSource</tt> to look up in the registry. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>placeholder</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>#</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.4:</b> Specifies a character that will be replaced to <tt>?</tt> in SQL query. Notice, that it is simple <tt>String.replaceAll()</tt> operation and no SQL parsing is involved (quoted strings will also change). This replacement is <b>only</b> happening if the endpoint is created using the <tt>SqlComponent</tt>. If you manually create the endpoint, then use the expected <tt>?</tt> sign instead. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>template.&lt;xxx&gt;</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class="confluenceTd
 "> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Sets additional options on the Spring <tt>JdbcTemplate</tt> that is used behind the scenes to execute the queries. For instance, <tt>template.maxRows=10</tt>. For detailed documentation, see the <a shape="rect" class="external-link" href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/jdbc/core/JdbcTemplate.html" rel="nofollow">JdbcTemplate javadoc</a> documentation. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>allowNamedParameters</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> Whether to allow using named parameters in the queries. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.delay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>long</
 tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>500</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Delay in milliseconds between each poll. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.initialDelay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>long</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>1000</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Milliseconds before polling starts. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.useFixedDelay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Set to <tt>true</tt> to use fixed delay between polls, otherwise fixe
 d 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. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>maxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>int</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>0</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> An integer value to define the maximum number of messages to gather per poll. By default, no maximum is set. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.useIterator</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b>
  If <tt>true</tt> each row returned when polling will be processed individually. If <tt>false</tt> the entire <tt>java.util.List</tt> of data is set as the IN body. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.routeEmptyResultSet</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Whether to route a single empty <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> if there was no data to poll. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.onConsume</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">  <b>Camel 2.11:</b> <b>SQL consumer only:</b> After processing e
 ach row then this query can be executed to for example delete or mark the row as processed. The query can have parameter. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.onConsumeBatchComplete</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">  <b>Camel 2.11:</b> <b>SQL consumer only:</b> After processing the entire batch, this query can be executed to bulk update rows etc. The query cannot have parameters. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.expectedUpdateCount</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>int</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>-1</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> If using <tt>consumer.onConsume</tt> then this option can be us
 ed to set an expected number of rows being updated. Typically you may set this to <tt>1</tt> to expect one row to be updated. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.breakBatchOnConsumeFail</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">  <b>Camel 2.11:</b> <b>SQL consumer only:</b> If using <tt>consumer.onConsume</tt> and it fails, then this option controls whether to break out of the batch or continue processing the next row from the batch. </td></tr></tbody></table>
 </div>
 </div>
 
@@ -16392,6 +16405,29 @@ mock.assertIsSatisfied();
 </pre>
 </div></div>
 
+<h4><a shape="rect" name="BookComponentAppendix-Usingnamedparameters"></a>Using named parameters</h4>
+<p><b>Available as of Camel 2.11</b></p>
+
+<p>In the given route below, we want to get all the projects from the projects table. Notice the SQL query has 2 named parameters, :#lic and :#min.<br clear="none">
+Camel will then lookup for these parameters from the message body or message headers. Notice in the example above we set two headers with constant value<br clear="none">
+for the named parameters:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+   from(<span class="code-quote">"direct:projects"</span>)
+     .setHeader(<span class="code-quote">"lic"</span>, constant(<span class="code-quote">"ASF"</span>))
+     .setHeader(<span class="code-quote">"min"</span>, constant(123))
+     .to(<span class="code-quote">"sql:select * from projects where license = :#lic and id &gt; :#min order by id"</span>)
+</pre>
+</div></div>
+
+<p>Though if the message body is a <tt>java.util.Map</tt> then the named parameters will be taken from the body.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+   from(<span class="code-quote">"direct:projects"</span>)
+     .to(<span class="code-quote">"sql:select * from projects where license = :#lic and id &gt; :#min order by id"</span>)
+</pre>
+</div></div>
+
 <h3><a shape="rect" name="BookComponentAppendix-UsingtheJDBCbasedidempotentrepository"></a>Using the JDBC based idempotent repository</h3>
 <p><b>Available as of Camel 2.7</b>: In this section we will use the JDBC based idempotent repository.</p>
 

Modified: websites/production/camel/content/camel-2110-release.html
==============================================================================
--- websites/production/camel/content/camel-2110-release.html (original)
+++ websites/production/camel/content/camel-2110-release.html Thu Jan 17 14:25:23 2013
@@ -84,8 +84,7 @@
 
 <p>Welcome to the 2.11.0 release with approximately XXX issues resolved - including new features, improvements, and bug fixes, such as: </p>
 
-<ul><li>Added <a shape="rect" href="binding.html" title="Binding">Binding</a> support, so it is easy to combine things like a <a shape="rect" href="data-format.html" title="Data Format">Data Format</a> to an <a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a> for easier composition of routes.</li><li>Added support for SOAP 1.2 in <a shape="rect" href="soap.html" title="SOAP">SOAP</a> data format.</li><li><a shape="rect" href="cache.html" title="Cache">Cache</a> operation for add/update now supports expiry headers to control time to live/idle/eternal.</li><li>Added <tt>allowNullBody</tt> option to <a shape="rect" href="jms.html" title="JMS">JMS</a> to configure whether sending messages with no body is allowed.</li><li>Added <tt>connectOnStartup</tt> option to <a shape="rect" href="hdfs.html" title="HDFS">HDFS</a> to allow to connect on demand, to avoid having Hadoop block for long time connecting to the HDFS cluster, as it has a hardcoded 15 minute retry mechan
 ism.</li><li>Added support for daily and weekly trends to <a shape="rect" href="twitter.html" title="Twitter">Twitter</a> component.</li><li>The <a shape="rect" href="camel-maven-archetypes.html" title="Camel Maven Archetypes">Camel Maven Archetypes</a> now generates projects without any license headers.</li><li>Added <tt>rejectOld</tt> option to the <a shape="rect" href="resequencer.html" title="Resequencer">Resequencer</a> to prevent out of order messages from being delivered after capacity/timeout events occur</li><li>Further optimized <a shape="rect" href="xpath.html" title="XPath">XPath</a> under concurrent load, and as well ensured resources are cleaned up eagerly</li><li>Added options <tt>allowNullBody</tt> and <tt>readLockMinLength</tt> to the <a shape="rect" href="file2.html" title="File2">File</a> and <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> components.</li><li>Made <tt>changed</tt> read lock strategy on <a shape="rect" href="ftp2.html" title="FTP2">FT
 P</a> go faster (eg when the FTP server has a lot of files in the directory) if you enable the <tt>fastExistsCheck=true</tt> option as well. Notice that some FTP server may not support this.</li><li><a shape="rect" href="hl7.html" title="HL7">HL7</a> moves to HAPI 2.0 and supports using a dedicated Parser instance in the <a shape="rect" href="hl7.html" title="HL7">HL7</a> MLLP codec and DataFormat. Added "Terser" language and expression to be able to extract fields from a parsed message. <a shape="rect" href="hl7.html" title="HL7">HL7</a> now uses Apache Mina 2.x.</li><li>Add an option <tt>HttpMethodRestrict</tt> to restrict HTTP method in <a shape="rect" href="jetty.html" title="Jetty">Jetty</a> and <a shape="rect" href="servlet.html" title="SERVLET">SERVLET</a></li><li>Add support for selection of <a shape="rect" href="direct-vm.html" title="Direct-VM">Direct-VM</a> consumers by using ant-like path expression.</li><li>The <a shape="rect" href="pojo-producing.html" title="P
 OJO Producing">POJO Producing</a>, and <a shape="rect" href="pojo-consuming.html" title="POJO Consuming">POJO Consuming</a> with @Consume, @Produce, @EndpointInject now supports a new {{property} attribute to get the endpoint configuration from a bean property (eg using a getter method); this allows you to configure this on the bean using conventional bean configuration.</li><li>Testing with <tt>camel-test-blueprint</tt> on Windows no longer tries to cleanup after testing taking up 5 seconds and logging WARNs.</li><li>The <a shape="rect" href="file2.html" title="File2">File</a>, and <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> components now support <tt>fileExist=Move</tt> option to move any existing files before writing a file.</li><li>Added option <tt>loadStatisticsEnabled</tt> on <a shape="rect" href="camel-jmx.html" title="Camel JMX">Camel JMX</a> to allow to disable load statistics if not needed (avoids a background thread being in use, to calculate the load st
 ats).</li><li>Enabled "lazy connections" for <a shape="rect" href="xmpp.html" title="XMPP">XMPP</a> providers via the <tt>testConnectionOnStartup</tt> option</li><li>Added a connection monitor to detect and fix dropped <a shape="rect" href="xmpp.html" title="XMPP">XMPP</a> consumer connections at configurable <tt>connectionPollDelay</tt> intervals</li><li>Added an <tt>org.apache.camel.builder.ExchangeBuilder</tt> to build the <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> using a builder pattern.</li><li>The <a shape="rect" href="camel-run-maven-goal.html" title="Camel Run Maven Goal">Camel Run Maven Goal</a> can now run <a shape="rect" href="cdi.html" title="CDI">CDI</a> applications.</li><li>The Camel <a shape="rect" href="cdi.html" title="CDI">CDI</a> component has improved a lot.</li><li>Added option <tt>allowRedeliveryWhileStopping</tt> to <a shape="rect" href="dead-letter-channel.html" title="Dead Letter Channel">error handlers</a> to control if red
 elivery is allowed during stopping/shutting down Camel or the route(s). Turning this option <tt>false</tt> allows to stop quicker by rejecting redelivery attempts.</li><li>Added support for specifying user info in Camel <a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a> urls, which contains the @ sign; now the @ sign can be given as is; without being encoded to %40.</li><li>Added robust connection support for <a shape="rect" href="jmx.html" title="JMX">JMX</a>. Optional <tt>testConnectionOnStartup</tt> allows a JMX consumer to attach to a JMX server that becomes available <em>after</em> the JMX endpoint starts; <tt>reconnectOnConnectionFailure</tt> enables re-connection of failed JMX connections.</li><li><a shape="rect" href="jaxb.html" title="JAXB">JAXB</a> and <a shape="rect" href="soap.html" title="SOAP">SOAP</a> data format now supports controlling namespace prefix mappings when marshalling (eg to avoid prefixes such as ns2, ns3, ns4 etc.)</li><li>Added s
 upport for using raw uris when <a shape="rect" href="component.html" title="Component">Component</a>s create <a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a>s. This gives component writers full power in case their component has special syntax/notation for endpoint uri configurations.</li><li><a shape="rect" href="eip.html" title="EIP">EIP</a>s configured with custom <tt>AggregationStrategy</tt> will now strict check the custom strategy exists in the <a shape="rect" href="registry.html" title="Registry">Registry</a> and no longer fallback and use a default strategy if not.</li><li>Camel now logs on shutdown if any thread pools hasn't been properly shutdown, and will shutdown them as fail safe (can only be done for the thread pools Camel manages).</li><li>The buffer size of <a shape="rect" href="stream-caching.html" title="Stream caching">Stream caching</a> is now configurable.</li><li>Improved startup performance.</li><li>Added <a shape="rect" href="jms.html
 " title="JMS">JMS</a> URI option <tt>messageListenerContainerFactoryRef</tt> which allows you to specify a <tt>MessageListenerContainerFactory</tt> to determine what <tt>org.springframework.jms.listener.AbstractMessageListenerContainer</tt> to use to consume messages.</li><li><a shape="rect" href="mqtt.html" title="MQTT">MQTT</a> producer now leverages the <a shape="rect" href="asynchronous-routing-engine.html" title="Asynchronous Routing Engine">Asynchronous Routing Engine</a></li><li>The <a shape="rect" href="netty.html" title="Netty">Netty</a> producer scales up and down much better by leveraging a channel pool.</li><li>Added new <a shape="rect" href="camel-maven-archetypes.html" title="Camel Maven Archetypes">Camel Maven Archetypes</a> for creating Camel and Groovy applications.</li><li>Camel now injects <tt>CamelContext</tt> on <tt>Language</tt> and <tt>DataFormat</tt> that implements <tt>CamelContextAware</tt></li><li>Thread pools in Camel with <tt>maximumQueueSize</tt
 > of 0 or negative will now not use a worker queue but do direct hand-over to thread instead.</li><li><a shape="rect" href="simple.html" title="Simple">Simple</a> unary operators for inc and dec must now have function on left hand side, to be parsed as unary function. Otherwise its now regarded as literal.</li><li>Custom assigned id's on Camel <a shape="rect" href="routes.html" title="Routes">Routes</a> is now validated on starting the routes, that they must be unique within the same CamelContext.</li><li>Added <tt>AbstractListAggregationStrategy</tt> abstract class to make it easier to <a shape="rect" href="aggregator2.html" title="Aggregator2">aggregate</a> into a List&lt;V&gt; using a custom <tt>AggregationStrategy</tt>.</li><li><a shape="rect" href="eip.html" title="EIP">EIP</a>s which support using <tt>AggregationStrategy</tt> now control the lifecycle of the strategy; allowing end users to do custom logic in the start/stop methods of their strategy implementation.</li>
 <li>Added option <tt>includeSentJMSMessageID</tt> to <a shape="rect" href="jms.html" title="JMS">JMS</a> to allow to enrich Camel Message with the actual JMSMessageID for the sent message. Can be used by end users for logging purpose etc.</li><li>Added option <tt>allowShortLines</tt> and <tt>ignoreExtraColumns</tt> to <a shape="rect" href="flatpack-dataformat.html" title="Flatpack DataFormat">Flatpack data format</a>.</li><li><a shape="rect" href="mail.html" title="Mail">Mail</a> consumer now supports using search terms to filter mails by terms such as subject, from, body, sent date etc.</li><li>The cached script file in the <a shape="rect" href="language.html" title="Language">Language</a> component can now be cleared via JMX.</li><li>improved the karaf context-info command by adding a verbose mode to view endpoints list (now hidden by default) and adding stats on the number of active/inactive routes</li><li>Added support for <tt>UpdateList</tt>, <tt>DeleteList</tt> and <tt
 >ExecutorType</tt> to <a shape="rect" href="mybatis.html" title="MyBatis">MyBatis</a> component.</li><li>Added support for easier configuration of using concurrent message listener consumer when doing request/reply over <a shape="rect" href="jms.html" title="JMS">JMS</a>, by leveraging the existing <tt>concurrentConsumers</tt> and <tt>maxConcurrentConsumers</tt> options.</li><li>Improved the <a shape="rect" href="smpp.html" title="SMPP">SMPP</a> consumer to expose more data by receiving a <tt>DeliverSM</tt> message.</li><li>Camels <a shape="rect" href="using-propertyplaceholder.html" title="Using PropertyPlaceholder">property placeholders</a> can now be used in route id / node id's in the routes in XML and Java DSLs, eg &lt;route id="<tt>coolName</tt>"&gt;</li><li>The thread name pattern can easily be configured on &lt;camelContext&gt; with the new threadNamePattern attribute</li><li>Camel now validates <a shape="rect" href="seda.html" title="SEDA">SEDA</a> and <a shape="rec
 t" href="vm.html" title="VM">VM</a> endpoints using same queue name, that if any queue size is in use, that size must match. As well Camel logs at INFO level when starting up the queues and the sizes. This allows end users to easily spot any issues if mistakenly using different queue sizes for the same queue names.</li><li>Added <a shape="rect" href="camel-jmx.html" title="Camel JMX">JMX</a> operations to <a shape="rect" href="log.html" title="Log">throughput logger</a> so you can get stats and also reset the stats at runtime.</li><li>Added ACL support on the <a shape="rect" href="aws-s3.html" title="AWS-S3">AWS-S3</a> component.</li><li>Allow to configure <a shape="rect" href="jetty.html" title="Jetty">Jetty</a> http client thread pool settings in uri to make it easier to have different settings per endpoint.</li><li>Added support for implied decimal formats to <a shape="rect" href="bindy.html" title="Bindy">Bindy</a></li><li>Added option <tt>backlog</tt> to <a shape="rect"
  href="netty.html" title="Netty">Netty</a> which can be used to allow more concurrent clients to connect to a <a shape="rect" href="netty.html" title="Netty">Netty</a> consumer.</li><li>Added support for parsing CSV if a field has a ' (single quote) at it's beging</li><li>Added support for using custom url rewrite plugins in <a shape="rect" href="http.html" title="HTTP">HTTP</a>, <a shape="rect" href="http4.html" title="HTTP4">HTTP4</a>, and <a shape="rect" href="jetty.html" title="Jetty">Jetty</a> producers, which gives more control of url mappings, such as when bridging/proxying http based routes. Provided <tt><a shape="rect" href="urlrewrite.html" title="UrlRewrite">camel-urlrewrite</a></tt> as out of the box implementation.</li><li>Improved the <a shape="rect" href="springintegration.html" title="SpringIntegration">Spring-Integration</a> consumer to also send back the message headers.</li><li>The Camel <a shape="rect" href="guice.html" title="Guice">Guice</a> component h
 as been upgraded to latest Guice 3.0, and no longer dependent on Guice extension project <tt>guiceyfruit</tt>.</li><li>ReplyTo Temporary Queue now refreshed when the underlying <a shape="rect" href="jms.html" title="JMS">JMS</a> Connection fails.</li><li>When processing an <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> fails, the failed route id is available for end users. See details at <a shape="rect" href="dead-letter-channel.html" title="Dead Letter Channel">Dead Letter Channel</a>.</li><li>When using <a shape="rect" href="xslt.html" title="XSLT">XSLT</a> includes will use same file or classpath loading as endpoint configuration, if not explicit configured.</li><li>Now <a shape="rect" href="camel-transport-for-cxf.html" title="Camel Transport for CXF">Camel Transport for CXF</a> supports to configure with blueprint.</li></ul>
-
+<ul><li>Added <a shape="rect" href="binding.html" title="Binding">Binding</a> support, so it is easy to combine things like a <a shape="rect" href="data-format.html" title="Data Format">Data Format</a> to an <a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a> for easier composition of routes.</li><li>Added support for SOAP 1.2 in <a shape="rect" href="soap.html" title="SOAP">SOAP</a> data format.</li><li><a shape="rect" href="cache.html" title="Cache">Cache</a> operation for add/update now supports expiry headers to control time to live/idle/eternal.</li><li>Added <tt>allowNullBody</tt> option to <a shape="rect" href="jms.html" title="JMS">JMS</a> to configure whether sending messages with no body is allowed.</li><li>Added <tt>connectOnStartup</tt> option to <a shape="rect" href="hdfs.html" title="HDFS">HDFS</a> to allow to connect on demand, to avoid having Hadoop block for long time connecting to the HDFS cluster, as it has a hardcoded 15 minute retry mechan
 ism.</li><li>Added support for daily and weekly trends to <a shape="rect" href="twitter.html" title="Twitter">Twitter</a> component.</li><li>The <a shape="rect" href="camel-maven-archetypes.html" title="Camel Maven Archetypes">Camel Maven Archetypes</a> now generates projects without any license headers.</li><li>Added <tt>rejectOld</tt> option to the <a shape="rect" href="resequencer.html" title="Resequencer">Resequencer</a> to prevent out of order messages from being delivered after capacity/timeout events occur</li><li>Further optimized <a shape="rect" href="xpath.html" title="XPath">XPath</a> under concurrent load, and as well ensured resources are cleaned up eagerly</li><li>Added options <tt>allowNullBody</tt> and <tt>readLockMinLength</tt> to the <a shape="rect" href="file2.html" title="File2">File</a> and <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> components.</li><li>Made <tt>changed</tt> read lock strategy on <a shape="rect" href="ftp2.html" title="FTP2">FT
 P</a> go faster (eg when the FTP server has a lot of files in the directory) if you enable the <tt>fastExistsCheck=true</tt> option as well. Notice that some FTP server may not support this.</li><li><a shape="rect" href="hl7.html" title="HL7">HL7</a> moves to HAPI 2.0 and supports using a dedicated Parser instance in the <a shape="rect" href="hl7.html" title="HL7">HL7</a> MLLP codec and DataFormat. Added "Terser" language and expression to be able to extract fields from a parsed message. <a shape="rect" href="hl7.html" title="HL7">HL7</a> now uses Apache Mina 2.x.</li><li>Add an option <tt>HttpMethodRestrict</tt> to restrict HTTP method in <a shape="rect" href="jetty.html" title="Jetty">Jetty</a> and <a shape="rect" href="servlet.html" title="SERVLET">SERVLET</a></li><li>Add support for selection of <a shape="rect" href="direct-vm.html" title="Direct-VM">Direct-VM</a> consumers by using ant-like path expression.</li><li>The <a shape="rect" href="pojo-producing.html" title="P
 OJO Producing">POJO Producing</a>, and <a shape="rect" href="pojo-consuming.html" title="POJO Consuming">POJO Consuming</a> with @Consume, @Produce, @EndpointInject now supports a new {{property} attribute to get the endpoint configuration from a bean property (eg using a getter method); this allows you to configure this on the bean using conventional bean configuration.</li><li>Testing with <tt>camel-test-blueprint</tt> on Windows no longer tries to cleanup after testing taking up 5 seconds and logging WARNs.</li><li>The <a shape="rect" href="file2.html" title="File2">File</a>, and <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> components now support <tt>fileExist=Move</tt> option to move any existing files before writing a file.</li><li>Added option <tt>loadStatisticsEnabled</tt> on <a shape="rect" href="camel-jmx.html" title="Camel JMX">Camel JMX</a> to allow to disable load statistics if not needed (avoids a background thread being in use, to calculate the load st
 ats).</li><li>Enabled "lazy connections" for <a shape="rect" href="xmpp.html" title="XMPP">XMPP</a> providers via the <tt>testConnectionOnStartup</tt> option</li><li>Added a connection monitor to detect and fix dropped <a shape="rect" href="xmpp.html" title="XMPP">XMPP</a> consumer connections at configurable <tt>connectionPollDelay</tt> intervals</li><li>Added an <tt>org.apache.camel.builder.ExchangeBuilder</tt> to build the <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> using a builder pattern.</li><li>The <a shape="rect" href="camel-run-maven-goal.html" title="Camel Run Maven Goal">Camel Run Maven Goal</a> can now run <a shape="rect" href="cdi.html" title="CDI">CDI</a> applications.</li><li>The Camel <a shape="rect" href="cdi.html" title="CDI">CDI</a> component has improved a lot.</li><li>Added option <tt>allowRedeliveryWhileStopping</tt> to <a shape="rect" href="dead-letter-channel.html" title="Dead Letter Channel">error handlers</a> to control if red
 elivery is allowed during stopping/shutting down Camel or the route(s). Turning this option <tt>false</tt> allows to stop quicker by rejecting redelivery attempts.</li><li>Added support for specifying user info in Camel <a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a> urls, which contains the @ sign; now the @ sign can be given as is; without being encoded to %40.</li><li>Added robust connection support for <a shape="rect" href="jmx.html" title="JMX">JMX</a>. Optional <tt>testConnectionOnStartup</tt> allows a JMX consumer to attach to a JMX server that becomes available <em>after</em> the JMX endpoint starts; <tt>reconnectOnConnectionFailure</tt> enables re-connection of failed JMX connections.</li><li><a shape="rect" href="jaxb.html" title="JAXB">JAXB</a> and <a shape="rect" href="soap.html" title="SOAP">SOAP</a> data format now supports controlling namespace prefix mappings when marshalling (eg to avoid prefixes such as ns2, ns3, ns4 etc.)</li><li>Added s
 upport for using raw uris when <a shape="rect" href="component.html" title="Component">Component</a>s create <a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a>s. This gives component writers full power in case their component has special syntax/notation for endpoint uri configurations.</li><li><a shape="rect" href="eip.html" title="EIP">EIP</a>s configured with custom <tt>AggregationStrategy</tt> will now strict check the custom strategy exists in the <a shape="rect" href="registry.html" title="Registry">Registry</a> and no longer fallback and use a default strategy if not.</li><li>Camel now logs on shutdown if any thread pools hasn't been properly shutdown, and will shutdown them as fail safe (can only be done for the thread pools Camel manages).</li><li>The buffer size of <a shape="rect" href="stream-caching.html" title="Stream caching">Stream caching</a> is now configurable.</li><li>Improved startup performance.</li><li>Added <a shape="rect" href="jms.html
 " title="JMS">JMS</a> URI option <tt>messageListenerContainerFactoryRef</tt> which allows you to specify a <tt>MessageListenerContainerFactory</tt> to determine what <tt>org.springframework.jms.listener.AbstractMessageListenerContainer</tt> to use to consume messages.</li><li><a shape="rect" href="mqtt.html" title="MQTT">MQTT</a> producer now leverages the <a shape="rect" href="asynchronous-routing-engine.html" title="Asynchronous Routing Engine">Asynchronous Routing Engine</a></li><li>The <a shape="rect" href="netty.html" title="Netty">Netty</a> producer scales up and down much better by leveraging a channel pool.</li><li>Added new <a shape="rect" href="camel-maven-archetypes.html" title="Camel Maven Archetypes">Camel Maven Archetypes</a> for creating Camel and Groovy applications.</li><li>Camel now injects <tt>CamelContext</tt> on <tt>Language</tt> and <tt>DataFormat</tt> that implements <tt>CamelContextAware</tt></li><li>Thread pools in Camel with <tt>maximumQueueSize</tt
 > of 0 or negative will now not use a worker queue but do direct hand-over to thread instead.</li><li><a shape="rect" href="simple.html" title="Simple">Simple</a> unary operators for inc and dec must now have function on left hand side, to be parsed as unary function. Otherwise its now regarded as literal.</li><li>Custom assigned id's on Camel <a shape="rect" href="routes.html" title="Routes">Routes</a> is now validated on starting the routes, that they must be unique within the same CamelContext.</li><li>Added <tt>AbstractListAggregationStrategy</tt> abstract class to make it easier to <a shape="rect" href="aggregator2.html" title="Aggregator2">aggregate</a> into a List&lt;V&gt; using a custom <tt>AggregationStrategy</tt>.</li><li><a shape="rect" href="eip.html" title="EIP">EIP</a>s which support using <tt>AggregationStrategy</tt> now control the lifecycle of the strategy; allowing end users to do custom logic in the start/stop methods of their strategy implementation.</li>
 <li>Added option <tt>includeSentJMSMessageID</tt> to <a shape="rect" href="jms.html" title="JMS">JMS</a> to allow to enrich Camel Message with the actual JMSMessageID for the sent message. Can be used by end users for logging purpose etc.</li><li>Added option <tt>allowShortLines</tt> and <tt>ignoreExtraColumns</tt> to <a shape="rect" href="flatpack-dataformat.html" title="Flatpack DataFormat">Flatpack data format</a>.</li><li><a shape="rect" href="mail.html" title="Mail">Mail</a> consumer now supports using search terms to filter mails by terms such as subject, from, body, sent date etc.</li><li>The cached script file in the <a shape="rect" href="language.html" title="Language">Language</a> component can now be cleared via JMX.</li><li>improved the karaf context-info command by adding a verbose mode to view endpoints list (now hidden by default) and adding stats on the number of active/inactive routes</li><li>Added support for <tt>UpdateList</tt>, <tt>DeleteList</tt> and <tt
 >ExecutorType</tt> to <a shape="rect" href="mybatis.html" title="MyBatis">MyBatis</a> component.</li><li>Added support for easier configuration of using concurrent message listener consumer when doing request/reply over <a shape="rect" href="jms.html" title="JMS">JMS</a>, by leveraging the existing <tt>concurrentConsumers</tt> and <tt>maxConcurrentConsumers</tt> options.</li><li>Improved the <a shape="rect" href="smpp.html" title="SMPP">SMPP</a> consumer to expose more data by receiving a <tt>DeliverSM</tt> message.</li><li>Camels <a shape="rect" href="using-propertyplaceholder.html" title="Using PropertyPlaceholder">property placeholders</a> can now be used in route id / node id's in the routes in XML and Java DSLs, eg &lt;route id="<tt>coolName</tt>"&gt;</li><li>The thread name pattern can easily be configured on &lt;camelContext&gt; with the new threadNamePattern attribute</li><li>Camel now validates <a shape="rect" href="seda.html" title="SEDA">SEDA</a> and <a shape="rec
 t" href="vm.html" title="VM">VM</a> endpoints using same queue name, that if any queue size is in use, that size must match. As well Camel logs at INFO level when starting up the queues and the sizes. This allows end users to easily spot any issues if mistakenly using different queue sizes for the same queue names.</li><li>Added <a shape="rect" href="camel-jmx.html" title="Camel JMX">JMX</a> operations to <a shape="rect" href="log.html" title="Log">throughput logger</a> so you can get stats and also reset the stats at runtime.</li><li>Added ACL support on the <a shape="rect" href="aws-s3.html" title="AWS-S3">AWS-S3</a> component.</li><li>Allow to configure <a shape="rect" href="jetty.html" title="Jetty">Jetty</a> http client thread pool settings in uri to make it easier to have different settings per endpoint.</li><li>Added support for implied decimal formats to <a shape="rect" href="bindy.html" title="Bindy">Bindy</a></li><li>Added option <tt>backlog</tt> to <a shape="rect"
  href="netty.html" title="Netty">Netty</a> which can be used to allow more concurrent clients to connect to a <a shape="rect" href="netty.html" title="Netty">Netty</a> consumer.</li><li>Added support for parsing CSV if a field has a ' (single quote) at it's beging</li><li>Added support for using custom url rewrite plugins in <a shape="rect" href="http.html" title="HTTP">HTTP</a>, <a shape="rect" href="http4.html" title="HTTP4">HTTP4</a>, and <a shape="rect" href="jetty.html" title="Jetty">Jetty</a> producers, which gives more control of url mappings, such as when bridging/proxying http based routes. Provided <tt><a shape="rect" href="urlrewrite.html" title="UrlRewrite">camel-urlrewrite</a></tt> as out of the box implementation.</li><li>Improved the <a shape="rect" href="springintegration.html" title="SpringIntegration">Spring-Integration</a> consumer to also send back the message headers.</li><li>The Camel <a shape="rect" href="guice.html" title="Guice">Guice</a> component h
 as been upgraded to latest Guice 3.0, and no longer dependent on Guice extension project <tt>guiceyfruit</tt>.</li><li>ReplyTo Temporary Queue now refreshed when the underlying <a shape="rect" href="jms.html" title="JMS">JMS</a> Connection fails.</li><li>When processing an <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> fails, the failed route id is available for end users. See details at <a shape="rect" href="dead-letter-channel.html" title="Dead Letter Channel">Dead Letter Channel</a>.</li><li>When using <a shape="rect" href="xslt.html" title="XSLT">XSLT</a> includes will use same file or classpath loading as endpoint configuration, if not explicit configured.</li><li>Now <a shape="rect" href="camel-transport-for-cxf.html" title="Camel Transport for CXF">Camel Transport for CXF</a> supports to configure with blueprint.</li><li><a shape="rect" href="sql-component.html" title="SQL Component">SQL Component</a> now supports named parameters in the queries.</
 li><li><a shape="rect" href="sql-component.html" title="SQL Component">SQL Component</a> now supports <a shape="rect" href="batch-consumer.html" title="Batch Consumer">Batch Consumer</a> to consume data; for example to pickup new rows being inserted into a table. As well having queries being execute after each row has been processed, such as deleting/marking the row as processed.</li></ul>
 
 
 <h3><a shape="rect" name="Camel2.11.0Release-Fixedissues"></a>Fixed issues</h3>

Modified: websites/production/camel/content/sql-component.html
==============================================================================
--- websites/production/camel/content/sql-component.html (original)
+++ websites/production/camel/content/sql-component.html Thu Jan 17 14:25:23 2013
@@ -112,6 +112,19 @@ sql:select * from table where id=# order
 </pre>
 </div></div>
 
+<p>From Camel 2.11 onwards you can use named parameters by using <tt>#:name</tt> style as shown:  </p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+sql:select * from table where id=#:myId order by name[?options]
+</pre>
+</div></div>
+
+<p>When using named parameters, Camel will lookup the names from, in the given precedence:<br clear="none">
+1. from message body if its a <tt>java.util.Map</tt><br clear="none">
+2. from message headers</p>
+
+<p>If a named parameter cannot be resolved, then an exception is thrown.</p>
+
 <p>Notice that the standard <tt>?</tt> symbol that denotes the parameters to an SQL query is substituted with the <tt>#</tt> symbol, because the <tt>?</tt> symbol is used to specify options for the endpoint. The <tt>?</tt> symbol replacement can be configured on endpoint basis.</p>
 
 <p>You can append query options to the URI in the following format, <tt>?option=value&amp;option=value&amp;...</tt></p>
@@ -119,7 +132,7 @@ sql:select * from table where id=# order
 <h3><a shape="rect" name="SQLComponent-Options"></a>Options</h3>
 
 <div class="confluenceTableSmall"><div class="table-wrap">
-<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Option </th><th colspan="1" rowspan="1" class="confluenceTh"> Type </th><th colspan="1" rowspan="1" class="confluenceTh"> Default </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>batch</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.7.5, 2.8.4 and 2.9:</b> Execute SQL batch update statements. See notes below on how the treatment of the inbound message body changes if this is set to <tt>true</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>dataSourceRef</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1
 " rowspan="1" class="confluenceTd"> Reference to a <tt>DataSource</tt> to look up in the registry. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>placeholder</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>#</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.4:</b> Specifies a character that will be replaced to <tt>?</tt> in SQL query. Notice, that it is simple <tt>String.replaceAll()</tt> operation and no SQL parsing is involved (quoted strings will also change) </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>template.&lt;xxx&gt;</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Sets additional options on the Spring <tt>JdbcTemplate</tt> that is used behind the scenes to execute the queries. 
 For instance, <tt>template.maxRows=10</tt>. For detailed documentation, see the <a shape="rect" class="external-link" href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/jdbc/core/JdbcTemplate.html" rel="nofollow">JdbcTemplate javadoc</a> documentation. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.delay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>long</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>500</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Delay in milliseconds between each poll. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.initialDelay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>long</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>1000</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Millis
 econds before polling starts. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.useFixedDelay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Set to <tt>true</tt> to use fixed delay between polls, 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. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>maxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>int</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>0</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> An int
 eger value to define the maximum number of messages to gather per poll. By default, no maximum is set. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.useIterator</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> If <tt>true</tt> each row returned when polling will be processed individually. If <tt>false</tt> the entire <tt>java.util.List</tt> of data is set as the IN body. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.routeEmptyResultSet</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Whether to route a single empty <a shape="r
 ect" href="exchange.html" title="Exchange">Exchange</a> if there was no data to poll. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.expectedUpdateCount</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>int</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>-1</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> If using <tt>consumer.onConsume</tt> then this option can be used to set an expected number of rows being updated. Typically you may set this to <tt>1</tt> to expect one row to be updated. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.breakBatchOnConsumeFail</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">  <b>Camel 2.11:</b> <b>SQL consumer only:</b> If using <tt>consumer.onCons
 ume</tt> and it fails, then this option controls whether to break out of the batch or continue processing the next row from the batch. </td></tr></tbody></table>
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Option </th><th colspan="1" rowspan="1" class="confluenceTh"> Type </th><th colspan="1" rowspan="1" class="confluenceTh"> Default </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>batch</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.7.5, 2.8.4 and 2.9:</b> Execute SQL batch update statements. See notes below on how the treatment of the inbound message body changes if this is set to <tt>true</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>dataSourceRef</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1
 " rowspan="1" class="confluenceTd"> Reference to a <tt>DataSource</tt> to look up in the registry. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>placeholder</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>#</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.4:</b> Specifies a character that will be replaced to <tt>?</tt> in SQL query. Notice, that it is simple <tt>String.replaceAll()</tt> operation and no SQL parsing is involved (quoted strings will also change). This replacement is <b>only</b> happening if the endpoint is created using the <tt>SqlComponent</tt>. If you manually create the endpoint, then use the expected <tt>?</tt> sign instead. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>template.&lt;xxx&gt;</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class="confluenceTd
 "> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Sets additional options on the Spring <tt>JdbcTemplate</tt> that is used behind the scenes to execute the queries. For instance, <tt>template.maxRows=10</tt>. For detailed documentation, see the <a shape="rect" class="external-link" href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/jdbc/core/JdbcTemplate.html" rel="nofollow">JdbcTemplate javadoc</a> documentation. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>allowNamedParameters</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> Whether to allow using named parameters in the queries. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.delay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>long</
 tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>500</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Delay in milliseconds between each poll. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.initialDelay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>long</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>1000</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Milliseconds before polling starts. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.useFixedDelay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Set to <tt>true</tt> to use fixed delay between polls, otherwise fixe
 d 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. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>maxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>int</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>0</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> An integer value to define the maximum number of messages to gather per poll. By default, no maximum is set. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.useIterator</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b>
  If <tt>true</tt> each row returned when polling will be processed individually. If <tt>false</tt> the entire <tt>java.util.List</tt> of data is set as the IN body. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.routeEmptyResultSet</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> Whether to route a single empty <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> if there was no data to poll. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.onConsume</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">  <b>Camel 2.11:</b> <b>SQL consumer only:</b> After processing e
 ach row then this query can be executed to for example delete or mark the row as processed. The query can have parameter. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.onConsumeBatchComplete</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>String</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">  <b>Camel 2.11:</b> <b>SQL consumer only:</b> After processing the entire batch, this query can be executed to bulk update rows etc. The query cannot have parameters. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.expectedUpdateCount</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>int</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>-1</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> <b>SQL consumer only:</b> If using <tt>consumer.onConsume</tt> then this option can be us
 ed to set an expected number of rows being updated. Typically you may set this to <tt>1</tt> to expect one row to be updated. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.breakBatchOnConsumeFail</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>boolean</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">  <b>Camel 2.11:</b> <b>SQL consumer only:</b> If using <tt>consumer.onConsume</tt> and it fails, then this option controls whether to break out of the batch or continue processing the next row from the batch. </td></tr></tbody></table>
 </div>
 </div>
 
@@ -212,6 +225,29 @@ mock.assertIsSatisfied();
 </pre>
 </div></div>
 
+<h4><a shape="rect" name="SQLComponent-Usingnamedparameters"></a>Using named parameters</h4>
+<p><b>Available as of Camel 2.11</b></p>
+
+<p>In the given route below, we want to get all the projects from the projects table. Notice the SQL query has 2 named parameters, :#lic and :#min.<br clear="none">
+Camel will then lookup for these parameters from the message body or message headers. Notice in the example above we set two headers with constant value<br clear="none">
+for the named parameters:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+   from(<span class="code-quote">"direct:projects"</span>)
+     .setHeader(<span class="code-quote">"lic"</span>, constant(<span class="code-quote">"ASF"</span>))
+     .setHeader(<span class="code-quote">"min"</span>, constant(123))
+     .to(<span class="code-quote">"sql:select * from projects where license = :#lic and id &gt; :#min order by id"</span>)
+</pre>
+</div></div>
+
+<p>Though if the message body is a <tt>java.util.Map</tt> then the named parameters will be taken from the body.</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+   from(<span class="code-quote">"direct:projects"</span>)
+     .to(<span class="code-quote">"sql:select * from projects where license = :#lic and id &gt; :#min order by id"</span>)
+</pre>
+</div></div>
+
 <h3><a shape="rect" name="SQLComponent-UsingtheJDBCbasedidempotentrepository"></a>Using the JDBC based idempotent repository</h3>
 <p><b>Available as of Camel 2.7</b>: In this section we will use the JDBC based idempotent repository.</p>
 



Mime
View raw message