You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2012/09/26 22:17:34 UTC

svn commit: r833104 - in /websites/production/camel/content: cache/main.pageCache sjms.html

Author: buildbot
Date: Wed Sep 26 20:17:33 2012
New Revision: 833104

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/sjms.html

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/camel/content/sjms.html
==============================================================================
--- websites/production/camel/content/sjms.html (original)
+++ websites/production/camel/content/sjms.html Wed Sep 26 20:17:33 2012
@@ -194,9 +194,9 @@ component.setMaxConnections(1);
 
 <h4><a shape="rect" name="SJMS-PlugableConnectionResourceManagement"></a>Plugable Connection Resource Management <a shape="rect" name="SJMS-connectionresource"></a></h4>
 
-<p>SJMS provides JMS <a shape="rect" class="external-link" href="http://docs.oracle.com/javaee/5/api/javax/jms/Connection.html" rel="nofollow">Connection</a> resource management through built-in connection pooling. This eliminates the need to depend on third party API pooling logic. However there may be times that you are required to use an external Connection resource manager such as those provided by J2EE or OSGi containers. For this SJMS provides an interface that can be used to override the internal SJMS Connection pooling capabilities. This is accomplished through the <tt>ConnectionResource</tt> interface. </p>
+<p>SJMS provides JMS <a shape="rect" class="external-link" href="http://docs.oracle.com/javaee/5/api/javax/jms/Connection.html" rel="nofollow">Connection</a> resource management through built-in connection pooling. This eliminates the need to depend on third party API pooling logic. However there may be times that you are required to use an external Connection resource manager such as those provided by J2EE or OSGi containers. For this SJMS provides an interface that can be used to override the internal SJMS Connection pooling capabilities. This is accomplished through the <a shape="rect" class="external-link" href="https://svn.apache.org/repos/asf/camel/trunk/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/ConnectionResource.java">ConnectionResource</a> interface. </p>
 
-<p>The <tt>ConnectionResource</tt> provides methods for borrowing and returning Connections as needed is the contract used to provide <a shape="rect" class="external-link" href="http://docs.oracle.com/javaee/5/api/javax/jms/Connection.html" rel="nofollow">Connection</a> pools to the SJMS component. A user should use when it is necessary to integrate SJMS with an external connection pooling manager.</p>
+<p>The <a shape="rect" class="external-link" href="https://svn.apache.org/repos/asf/camel/trunk/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/ConnectionResource.java">ConnectionResource</a> provides methods for borrowing and returning Connections as needed is the contract used to provide <a shape="rect" class="external-link" href="http://docs.oracle.com/javaee/5/api/javax/jms/Connection.html" rel="nofollow">Connection</a> pools to the SJMS component. A user should use when it is necessary to integrate SJMS with an external connection pooling manager.</p>
 
 <p>It is recommended though that for standard <a shape="rect" class="external-link" href="http://docs.oracle.com/javaee/5/api/javax/jms/ConnectionFactory.html" rel="nofollow">ConnectionFactory</a> providers you use the <a shape="rect" class="external-link" href="https://svn.apache.org/repos/asf/camel/trunk/components/camel-sjms/src/test/java/org/apache/camel/component/sjms/it/ConnectionResourceIT.java">ConnectionFactoryResource</a> implementation that is provided with SJMS as-is or extend as it is optimized for this component.</p>
 
@@ -208,7 +208,17 @@ component.setMaxConnections(1);
 
 <h4><a shape="rect" name="SJMS-TransactedBatchConsumers%26Producers"></a>Transacted Batch Consumers &amp; Producers</h4>
 
-<p>Coming soon ...</p>
+<p>The SjmsComponent has been designed to support the batching of local JMS transactions on both the Producer and Consumer endpoints. How they are handled on each is very different though.</p>
+
+<p>The SjmsConsumer endpoint is a straitforward implementation that will process X messages before committing them with the associated Session.  To enable batched transaction on the consumer first enable transactions by setting the <tt>transacted</tt> parameter to true and then adding the <tt>transactionBatchCount</tt> and setting it to any value that is greater than 0. For example the following configuration will commit the Session every 10 messages:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+sjms:queue:transacted.batch.consumer?transacted=<span class="code-keyword">true</span>&amp;transactionBatchCount=10
+</pre>
+</div></div>
+
+<p>If an exception occurs during the processing of a batch on the consumer endpoint, the Session rollback is invoked causing the messages to be redelivered to the next available consumer. The counter is also reset to 0 for the BatchTransactionCommitStrategy for the associated Session as well. It is the responsibility of the user to ensure they put hooks in their processors of batch messages to watch for messages with the JMSRedelivered header set to true. This is the indicator that messages were rolled back at some point and that a verification of a successful processing should occur.</p>
 
 <h4><a shape="rect" name="SJMS-CustomizableTransactionCommitStrategies%28LocalJMSTransactionsonly%29"></a>Customizable Transaction Commit Strategies (Local JMS Transactions only)</h4>