camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r980023 - in /websites/production/camel/content: cache/main.pageCache sjms-batch.html
Date Wed, 10 Feb 2016 13:19:05 GMT
Author: buildbot
Date: Wed Feb 10 13:19:04 2016
New Revision: 980023

Log:
Production update by buildbot for camel

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

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

Modified: websites/production/camel/content/sjms-batch.html
==============================================================================
--- websites/production/camel/content/sjms-batch.html (original)
+++ websites/production/camel/content/sjms-batch.html Wed Feb 10 13:19:04 2016
@@ -85,14 +85,14 @@
 	<tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="SJMSBatch-SJMSBatchComponent">SJMS
Batch Component</h2><p><strong>Available as of Camel 2.16</strong></p><p>SJMS
Batch is a specialized component for highly performant, transactional batch consumption from
a JMS queue. It can be thought of as a hybrid of a consumer-only component and an <a shape="rect"
href="aggregator2.html">aggregator</a>.</p><p>A common use case in Camel
is to consume messages from a queue and aggregate them before sending the aggregated state
to another endpoint. In order to ensure that data is not lost if the system performing the
processing fails, it is typically consumed within a transaction from the queue, and once aggregated
stored in a persistent <code>AggregationRepository</code>, such as the one found
in the <a shape="rect" href="jdbc.html">JDBC Component</a>.</p><p>The
behavior of the aggregator pattern involves fetching data from the <code>AggregationRepository</code>
before an incoming message is aggregate
 d, and writing back the result afterwards. By nature, the reads and writes take progressively
longer as the number of aggregated artifacts increases. A rough example of this using arbitrary
time units that demonstrates the impact of this is as follows:</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">Item</th><th
colspan="1" rowspan="1" class="confluenceTh">Read Time</th><th colspan="1" rowspan="1"
class="confluenceTh">Write Time</th><th colspan="1" rowspan="1" class="confluenceTh">Total
Time</th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">0</td><td
colspan="1" rowspan="1" class="confluenceTd">0</td><td colspan="1" rowspan="1"
class="confluenceTd">1</td><td colspan="1" rowspan="1" class="confluenceTd">1</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">1</td><td colspan="1" rowspan="1"
class="confluenceTd">1</td><td colspan="1" rowspan="1" class="confluenceTd">2</td><td
colspan="1" rowspan
 ="1" class="confluenceTd">4</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">2</td><td colspan="1" rowspan="1" class="confluenceTd">2</td><td
colspan="1" rowspan="1" class="confluenceTd">3</td><td colspan="1" rowspan="1"
class="confluenceTd">9</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">3</td><td
colspan="1" rowspan="1" class="confluenceTd">3</td><td colspan="1" rowspan="1"
class="confluenceTd">4</td><td colspan="1" rowspan="1" class="confluenceTd">16</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">4</td><td colspan="1" rowspan="1"
class="confluenceTd">4</td><td colspan="1" rowspan="1" class="confluenceTd">5</td><td
colspan="1" rowspan="1" class="confluenceTd">25</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">5</td><td colspan="1" rowspan="1" class="confluenceTd">5</td><td
colspan="1" rowspan="1" class="confluenceTd">6</td><td colspan="1" rowspan="1"
class="confluenceTd">36</td></tr><tr><td colspan="1" rowspan="1" class="co
 nfluenceTd">6</td><td colspan="1" rowspan="1" class="confluenceTd">6</td><td
colspan="1" rowspan="1" class="confluenceTd">7</td><td colspan="1" rowspan="1"
class="confluenceTd">49</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">7</td><td
colspan="1" rowspan="1" class="confluenceTd">7</td><td colspan="1" rowspan="1"
class="confluenceTd">8</td><td colspan="1" rowspan="1" class="confluenceTd">64</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">8</td><td colspan="1" rowspan="1"
class="confluenceTd">8</td><td colspan="1" rowspan="1" class="confluenceTd">9</td><td
colspan="1" rowspan="1" class="confluenceTd">81</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">9</td><td colspan="1" rowspan="1" class="confluenceTd">9</td><td
colspan="1" rowspan="1" class="confluenceTd">10</td><td colspan="1" rowspan="1"
class="confluenceTd">100</td></tr></tbody></table></div><p>In
contrast, consumption performance using the SJMS Batch component is linear. Each message
  is consumed and aggregated using an <code>AggregationStrategy</code> before
the next one is fetched. As all of the consumption and aggregation is performed in a single
JMS transaction no external storage is required to persist the intermediate state - this avoids
the read and write costs described above. In practice, this yields multiple orders of magnitude
higher throughput.</p><p>Once a completion condition is met, either by size or
period since first message, the aggregated <code>Exchange</code> is passed into
the route. During the processing of this <code>Exchange</code>, if an exception
is thrown or the system shuts down, all of the original consumed messages end up back on the
queue (or are placed on the dead-letter queue depending on the broker configuration).</p><p>Unlike
using a regular aggregator, there is no facility for an aggregation condition, meaning that
it is not possible to batch consume into multiple groups of messages. All consumed messages
are aggregated togeth
 er into a single batch.</p><p>Multiple JMS consumer support is available which
allows you to consume in parallel using the one route, and at the same time use facilities
like JMS message groups to group related messages.</p><p>&#160;</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">
+<div class="wiki-content maincontent"><h2 id="SJMSBatch-SJMSBatchComponent">SJMS
Batch Component</h2><p><strong>Available as of Camel 2.16</strong></p><p>SJMS
Batch is a specialized component for highly performant, transactional batch consumption from
a JMS queue. It can be thought of as a hybrid of a consumer-only component and an <a shape="rect"
href="aggregator2.html">aggregator</a>.</p><p>A common use case in Camel
is to consume messages from a queue and aggregate them before sending the aggregated state
to another endpoint. In order to ensure that data is not lost if the system performing the
processing fails, it is typically consumed within a transaction from the queue, and once aggregated
stored in a persistent <code>AggregationRepository</code>, such as the one found
in the <a shape="rect" href="jdbc.html">JDBC Component</a>.</p><p>The
behavior of the aggregator pattern involves fetching data from the <code>AggregationRepository</code>
before an incoming message is aggregate
 d, and writing back the result afterwards. By nature, the reads and writes take progressively
longer as the number of aggregated artifacts increases. A rough example of this using arbitrary
time units that demonstrates the impact of this is as follows:</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">Item</th><th
colspan="1" rowspan="1" class="confluenceTh">Read Time</th><th colspan="1" rowspan="1"
class="confluenceTh">Write Time</th><th colspan="1" rowspan="1" class="confluenceTh">Total
Time</th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">0</td><td
colspan="1" rowspan="1" class="confluenceTd">0</td><td colspan="1" rowspan="1"
class="confluenceTd">1</td><td colspan="1" rowspan="1" class="confluenceTd">1</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">1</td><td colspan="1" rowspan="1"
class="confluenceTd">1</td><td colspan="1" rowspan="1" class="confluenceTd">2</td><td
colspan="1" rowspan
 ="1" class="confluenceTd">4</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">2</td><td colspan="1" rowspan="1" class="confluenceTd">2</td><td
colspan="1" rowspan="1" class="confluenceTd">3</td><td colspan="1" rowspan="1"
class="confluenceTd">9</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">3</td><td
colspan="1" rowspan="1" class="confluenceTd">3</td><td colspan="1" rowspan="1"
class="confluenceTd">4</td><td colspan="1" rowspan="1" class="confluenceTd">16</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">4</td><td colspan="1" rowspan="1"
class="confluenceTd">4</td><td colspan="1" rowspan="1" class="confluenceTd">5</td><td
colspan="1" rowspan="1" class="confluenceTd">25</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">5</td><td colspan="1" rowspan="1" class="confluenceTd">5</td><td
colspan="1" rowspan="1" class="confluenceTd">6</td><td colspan="1" rowspan="1"
class="confluenceTd">36</td></tr><tr><td colspan="1" rowspan="1" class="co
 nfluenceTd">6</td><td colspan="1" rowspan="1" class="confluenceTd">6</td><td
colspan="1" rowspan="1" class="confluenceTd">7</td><td colspan="1" rowspan="1"
class="confluenceTd">49</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">7</td><td
colspan="1" rowspan="1" class="confluenceTd">7</td><td colspan="1" rowspan="1"
class="confluenceTd">8</td><td colspan="1" rowspan="1" class="confluenceTd">64</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">8</td><td colspan="1" rowspan="1"
class="confluenceTd">8</td><td colspan="1" rowspan="1" class="confluenceTd">9</td><td
colspan="1" rowspan="1" class="confluenceTd">81</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">9</td><td colspan="1" rowspan="1" class="confluenceTd">9</td><td
colspan="1" rowspan="1" class="confluenceTd">10</td><td colspan="1" rowspan="1"
class="confluenceTd">100</td></tr></tbody></table></div><p>In
contrast, consumption performance using the SJMS Batch component is linear. Each message
  is consumed and aggregated using an <code>AggregationStrategy</code> before
the next one is fetched. As all of the consumption and aggregation is performed in a single
JMS transaction no external storage is required to persist the intermediate state - this avoids
the read and write costs described above. In practice, this yields multiple orders of magnitude
higher throughput.</p><p>Once a completion condition is met, either by size or
period since first message, the aggregated <code>Exchange</code> is passed into
the route. During the processing of this <code>Exchange</code>, if an exception
is thrown or the system shuts down, all of the original consumed messages end up back on the
queue (or are placed on the dead-letter queue depending on the broker configuration).</p><p>Unlike
using a regular aggregator, there is no facility for an aggregation condition, meaning that
it is not possible to batch consume into multiple groups of messages at the same time. All
consumed messages are 
 aggregated together into a single batch. To get around this, a common design approach is
to first sort the different groups of messages to be aggregated onto different queues, and
batch consume from each one separately.</p><p>Multiple JMS consumer support is
available which allows you to consume in parallel using the one route, and at the same time
use facilities like JMS message groups to group related messages.</p><p>&#160;</p><p>Maven
users will need to add the following dependency to their <code>pom.xml</code>
for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
     &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
     &lt;artifactId&gt;camel-sjms&lt;/artifactId&gt;
     &lt;version&gt;x.x.x&lt;/version&gt;
     &lt;!-- use the same version as your Camel core version --&gt;
 &lt;/dependency&gt;]]></script>
-</div></div><h4 id="SJMSBatch-URIformat">URI format</h4><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>SJMS Batch is a subcomponent of&#160;<a shape="rect"
href="sjms.html">SJMS</a>, and resides in the same library.</p><h4 id="SJMSBatch-URIformat">URI
format</h4><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[sjms:[queue:]destinationName[?options]
 ]]></script>
 </div></div><p>Where <code>destinationName</code> is a JMS
queue. By default, the <code>destinationName</code> is interpreted as a queue
name.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">



Mime
View raw message