Modified: websites/production/camel/content/book-pattern-appendix.html ============================================================================== --- websites/production/camel/content/book-pattern-appendix.html (original) +++ websites/production/camel/content/book-pattern-appendix.html Fri Sep 13 11:20:17 2013 @@ -2347,7 +2347,7 @@ from("direct:line") <h3><a shape="rect" name="BookPatternAppendix-Aggregatoroptions"></a>Aggregator options</h3> <p>The aggregator supports the following options:</p> <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"> Default </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> correlationExpression </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> Mandatory <a shape="rect" href="expression.html" title="Expression">Expression</a> which evaluates the correlation key to use for aggregation. The <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> which has the same correlation key is aggregated together. If the correlation key could not be evaluated an Exception is thrown. You can disable this by using the <tt>ignoreBadCorrelationKeys</tt> option. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> aggregationStrategy </td><td colspan="1" rowspan="1" class="confluenceTd"> </td ><td colspan="1" rowspan="1" class="confluenceTd"> Mandatory ><tt>AggregationStrategy</tt> which is used to <em>merge</em> the incoming <a >shape="rect" href="exchange.html" title="Exchange">Exchange</a> with the >existing already merged exchanges. At first call the <tt>oldExchange</tt> >parameter is <tt>null</tt>. On subsequent invocations the ><tt>oldExchange</tt> contains the merged exchanges and <tt>newExchange</tt> >is of course the new incoming Exchange. From <b>Camel 2.9.2</b> onwards the >strategy can also be a <tt>TimeoutAwareAggregationStrategy</tt> >implementation, supporting the timeout callback, see further below for more >details. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> >strategyRef </td><td colspan="1" rowspan="1" >class="confluenceTd"> </td><td colspan="1" rowspan="1" >class="confluenceTd"> A reference to lookup the <tt>AggregationStrategy</tt> >in the <a shape="rect" href="registry.html" title="Registry">Registry</a>. >From <b>Camel 2.12</b> onwards y ou can also use a POJO as the <tt>AggregationStrategy</tt>, see further below for details. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> strategyMethodName </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.12:</b> This option can be used to explicit declare the method name to use, when using POJOs as the <tt>AggregationStrategy</tt>. See further below for more details. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> strategyMethodAllowNull </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.12:</b> If this option is <tt>false</tt> then the aggregate method is not used for the very first aggregation. If this option is <tt>true</tt> then <tt>null</tt> values is used as the <tt>oldExchange</tt> (at the very first aggregation), when using POJOs as the <tt>AggregationStrategy</tt>. See further bel ow for more details. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> completionSize </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> Number of messages aggregated before the aggregation is complete. This option can be set as either a fixed value or using an <a shape="rect" href="expression.html" title="Expression">Expression</a> which allows you to evaluate a size dynamically - will use <tt>Integer</tt> as result. If both are set Camel will fallback to use the fixed value if the <a shape="rect" href="expression.html" title="Expression">Expression</a> result was <tt>null</tt> or <tt>0</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> completionTimeout </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> Time in millis that an aggregated exchange should be inactive before its complete. This option can be set as either a fix ed value or using an <a shape="rect" href="expression.html" title="Expression">Expression</a> which allows you to evaluate a timeout dynamically - will use <tt>Long</tt> as result. If both are set Camel will fallback to use the fixed value if the <a shape="rect" href="expression.html" title="Expression">Expression</a> result was <tt>null</tt> or <tt>0</tt>. You cannot use this option together with completionInterval, only one of the two can be used. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> completionInterval </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> A repeating period in millis by which the aggregator will complete all current aggregated exchanges. Camel has a background task which is triggered every period. You cannot use this option together with completionTimeout, only one of them can be used. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> completionPredicate </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> A <a shape="rect" href="predicate.html" title="Predicate">Predicate</a> to indicate when an aggregated exchange is complete. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> completionFromBatchConsumer </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> This option is if the exchanges are coming from a <a shape="rect" href="batch-consumer.html" title="Batch Consumer">Batch Consumer</a>. Then when enabled the <a shape="rect" href="aggregator2.html" title="Aggregator2">Aggregator2</a> will use the batch size determined by the <a shape="rect" href="batch-consumer.html" title="Batch Consumer">Batch Consumer</a> in the message header <tt>CamelBatchSize</tt>. See more details at <a shape="rect" href="batch-consumer.html" title="Batch Consumer">Batch Consumer</a>. This can be used to aggregate all f iles consumed from a <a shape="rect" href="file2.html" title="File2">File</a> endpoint in that given poll. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> forceCompletionOnStop </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.9</b> Indicates to complete all current aggregated exchanges when the context is stopped </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> eagerCheckCompletion </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Whether or not to eager check for completion when a new incoming <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> has been received. This option influences the behavior of the <tt>completionPredicate</tt> option as the <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> being passed in changes accordingly. When <tt>false</tt> the <a s hape="rect" href="exchange.html" title="Exchange">Exchange</a> passed in the <a shape="rect" href="predicate.html" title="Predicate">Predicate</a> is the <em>aggregated</em> Exchange which means any information you may store on the aggregated Exchange from the <tt>AggregationStrategy</tt> is available for the <a shape="rect" href="predicate.html" title="Predicate">Predicate</a>. When <tt>true</tt> the <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> passed in the <a shape="rect" href="predicate.html" title="Predicate">Predicate</a> is the <em>incoming</em> <a shape="rect" href="exchange.html" title="Exchange">Exchange</a>, which means you can access data from the incoming Exchange. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> groupExchanges </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> If enabled then Camel will group all aggregated Exchanges into a single combined <tt >org.apache.camel.impl.GroupedExchange</tt> holder class that holds all the >aggregated Exchanges. And as a result only one Exchange is being sent out >from the aggregator. Can be used to combine many incoming Exchanges into a >single output Exchange without coding a custom <tt>AggregationStrategy</tt> >yourself. <b>Important:</b> This option does <b>not</b> support persistant >repository with the aggregator. </td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"> ignoreInvalidCorrelationKeys </td><td colspan="1" >rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" >rowspan="1" class="confluenceTd"> Whether or not to ignore correlation keys >which could not be evaluated to a value. By default Camel will throw an >Exception, but you can enable this option and ignore the situation instead. ></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> >closeCorrelationKeyOnCompletion </td><td colspan="1" rowspan="1" >class="confluenceTd"> </td><td colspan="1" rows pan="1" class="confluenceTd"> Whether or not too <em>late</em> Exchanges should be accepted or not. You can enable this to indicate that if a correlation key has already been completed, then any new exchanges with the same correlation key be denied. Camel will then throw a <tt>closedCorrelationKeyException</tt> exception. When using this option you pass in a <tt>integer</tt> which is a number for a LRUCache which keeps that last X number of closed correlation keys. You can pass in 0 or a negative value to indicate a unbounded cache. By passing in a number you are ensured that cache won't grow too big if you use a log of different correlation keys. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> discardOnCompletionTimeout </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.5:</b> Whether or not exchanges which complete due to a timeout should be discarded. If enabled then when a timeou t occurs the aggregated message will <b>not</b> be sent out but dropped (discarded). </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> aggregationRepository </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> Allows you to plugin you own implementation of <tt>org.apache.camel.spi.AggregationRepository</tt> which keeps track of the current inflight aggregated exchanges. Camel uses by default a memory based implementation. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> aggregationRepositoryRef </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> Reference to lookup a <tt>aggregationRepository</tt> in the <a shape="rect" href="registry.html" title="Registry">Registry</a>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> parallelProcessing </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td c olspan="1" rowspan="1" class="confluenceTd"> When aggregated are completed they are being send out of the aggregator. This option indicates whether or not Camel should use a thread pool with multiple threads for concurrency. If no custom thread pool has been specified then Camel creates a default pool with 10 concurrent threads. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> executorService </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> If using <tt>parallelProcessing</tt> you can specify a custom thread pool to be used. In fact also if you are not using <tt>parallelProcessing</tt> this custom thread pool is used to send out aggregated exchanges as well. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> executorServiceRef </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> Reference to lookup a <tt>executorService</tt> in t he <a shape="rect" href="registry.html" title="Registry">Registry</a> </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> timeoutCheckerExecutorService </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.9:</b> If using either of the <tt>completionTimeout</tt>, <tt>completionTimeoutExpression</tt>, or <tt>completionInterval</tt> options a background thread is created to check for the completion for every aggregator. Set this option to provide a custom thread pool to be used rather than creating a new thread for every aggregator. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> timeoutCheckerExecutorServiceRef </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.9:</b> Reference to lookup a <tt>timeoutCheckerExecutorService</tt> in the <a shape="rect" href="registry.html" title="Registry">Registry</a> </td></tr>< tr><td colspan="1" rowspan="1" class="confluenceTd"> optimisticLocking </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> Turns on using optimistic locking, which requires the <tt>aggregationRepository</tt> being used, is supporting this by implementing the <tt>org.apache.camel.spi.OptimisticLockingAggregationRepository</tt> interface. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> optimisticLockRetryPolicy </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11.1:</b> Allows to configure retry settings when using optimistic locking. </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"> Default </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> correlationExpression </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> Mandatory <a shape="rect" href="expression.html" title="Expression">Expression</a> which evaluates the correlation key to use for aggregation. The <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> which has the same correlation key is aggregated together. If the correlation key could not be evaluated an Exception is thrown. You can disable this by using the <tt>ignoreBadCorrelationKeys</tt> option. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> aggregationStrategy </td><td colspan="1" rowspan="1" class="confluenceTd"> </td ><td colspan="1" rowspan="1" class="confluenceTd"> Mandatory ><tt>AggregationStrategy</tt> which is used to <em>merge</em> the incoming <a >shape="rect" href="exchange.html" title="Exchange">Exchange</a> with the >existing already merged exchanges. At first call the <tt>oldExchange</tt> >parameter is <tt>null</tt>. On subsequent invocations the ><tt>oldExchange</tt> contains the merged exchanges and <tt>newExchange</tt> >is of course the new incoming Exchange. From <b>Camel 2.9.2</b> onwards the >strategy can also be a <tt>TimeoutAwareAggregationStrategy</tt> >implementation, supporting the timeout callback, see further below for more >details. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> >strategyRef </td><td colspan="1" rowspan="1" >class="confluenceTd"> </td><td colspan="1" rowspan="1" >class="confluenceTd"> A reference to lookup the <tt>AggregationStrategy</tt> >in the <a shape="rect" href="registry.html" title="Registry">Registry</a>. >From <b>Camel 2.12</b> onwards y ou can also use a POJO as the <tt>AggregationStrategy</tt>, see further below for details. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> strategyMethodName </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.12:</b> This option can be used to explicit declare the method name to use, when using POJOs as the <tt>AggregationStrategy</tt>. See further below for more details. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> strategyMethodAllowNull </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.12:</b> If this option is <tt>false</tt> then the aggregate method is not used for the very first aggregation. If this option is <tt>true</tt> then <tt>null</tt> values is used as the <tt>oldExchange</tt> (at the very first aggregation), when using POJOs as the <tt>AggregationStrategy</tt>. See further bel ow for more details. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> completionSize </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> Number of messages aggregated before the aggregation is complete. This option can be set as either a fixed value or using an <a shape="rect" href="expression.html" title="Expression">Expression</a> which allows you to evaluate a size dynamically - will use <tt>Integer</tt> as result. If both are set Camel will fallback to use the fixed value if the <a shape="rect" href="expression.html" title="Expression">Expression</a> result was <tt>null</tt> or <tt>0</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> completionTimeout </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> Time in millis that an aggregated exchange should be inactive before its complete. This option can be set as either a fix ed value or using an <a shape="rect" href="expression.html" title="Expression">Expression</a> which allows you to evaluate a timeout dynamically - will use <tt>Long</tt> as result. If both are set Camel will fallback to use the fixed value if the <a shape="rect" href="expression.html" title="Expression">Expression</a> result was <tt>null</tt> or <tt>0</tt>. You cannot use this option together with completionInterval, only one of the two can be used. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> completionInterval </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> A repeating period in millis by which the aggregator will complete all current aggregated exchanges. Camel has a background task which is triggered every period. You cannot use this option together with completionTimeout, only one of them can be used. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> completionPredicate </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> A <a shape="rect" href="predicate.html" title="Predicate">Predicate</a> to indicate when an aggregated exchange is complete. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> completionFromBatchConsumer </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> This option is if the exchanges are coming from a <a shape="rect" href="batch-consumer.html" title="Batch Consumer">Batch Consumer</a>. Then when enabled the <a shape="rect" href="aggregator2.html" title="Aggregator2">Aggregator2</a> will use the batch size determined by the <a shape="rect" href="batch-consumer.html" title="Batch Consumer">Batch Consumer</a> in the message header <tt>CamelBatchSize</tt>. See more details at <a shape="rect" href="batch-consumer.html" title="Batch Consumer">Batch Consumer</a>. This can be used to aggregate all f iles consumed from a <a shape="rect" href="file2.html" title="File2">File</a> endpoint in that given poll. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> forceCompletionOnStop </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.9</b> Indicates to complete all current aggregated exchanges when the context is stopped </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> eagerCheckCompletion </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Whether or not to eager check for completion when a new incoming <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> has been received. This option influences the behavior of the <tt>completionPredicate</tt> option as the <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> being passed in changes accordingly. When <tt>false</tt> the <a s hape="rect" href="exchange.html" title="Exchange">Exchange</a> passed in the <a shape="rect" href="predicate.html" title="Predicate">Predicate</a> is the <em>aggregated</em> Exchange which means any information you may store on the aggregated Exchange from the <tt>AggregationStrategy</tt> is available for the <a shape="rect" href="predicate.html" title="Predicate">Predicate</a>. When <tt>true</tt> the <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> passed in the <a shape="rect" href="predicate.html" title="Predicate">Predicate</a> is the <em>incoming</em> <a shape="rect" href="exchange.html" title="Exchange">Exchange</a>, which means you can access data from the incoming Exchange. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> groupExchanges </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> If enabled then Camel will group all aggregated Exchanges into a single combined <tt >org.apache.camel.impl.GroupedExchange</tt> holder class that holds all the >aggregated Exchanges. And as a result only one Exchange is being sent out >from the aggregator. Can be used to combine many incoming Exchanges into a >single output Exchange without coding a custom <tt>AggregationStrategy</tt> >yourself. <b>Important:</b> This option does <b>not</b> support persistent >repository with the aggregator. See further below for an example and more >details. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> >ignoreInvalidCorrelationKeys </td><td colspan="1" rowspan="1" >class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" >class="confluenceTd"> Whether or not to ignore correlation keys which could >not be evaluated to a value. By default Camel will throw an Exception, but >you can enable this option and ignore the situation instead. ></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> >closeCorrelationKeyOnCompletion </td><td colspan="1" rowspan="1" c lass="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> Whether or not too <em>late</em> Exchanges should be accepted or not. You can enable this to indicate that if a correlation key has already been completed, then any new exchanges with the same correlation key be denied. Camel will then throw a <tt>closedCorrelationKeyException</tt> exception. When using this option you pass in a <tt>integer</tt> which is a number for a LRUCache which keeps that last X number of closed correlation keys. You can pass in 0 or a negative value to indicate a unbounded cache. By passing in a number you are ensured that cache won't grow too big if you use a log of different correlation keys. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> discardOnCompletionTimeout </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.5:</b> Whether or not exchanges which complete due to a timeout should be discarded. If enabled then when a timeout occurs the aggregated message will <b>not</b> be sent out but dropped (discarded). </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> aggregationRepository </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> Allows you to plugin you own implementation of <tt>org.apache.camel.spi.AggregationRepository</tt> which keeps track of the current inflight aggregated exchanges. Camel uses by default a memory based implementation. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> aggregationRepositoryRef </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> Reference to lookup a <tt>aggregationRepository</tt> in the <a shape="rect" href="registry.html" title="Registry">Registry</a>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> parallelProcessing </td><td colspan="1" rowspan= "1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> When aggregated are completed they are being send out of the aggregator. This option indicates whether or not Camel should use a thread pool with multiple threads for concurrency. If no custom thread pool has been specified then Camel creates a default pool with 10 concurrent threads. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> executorService </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> If using <tt>parallelProcessing</tt> you can specify a custom thread pool to be used. In fact also if you are not using <tt>parallelProcessing</tt> this custom thread pool is used to send out aggregated exchanges as well. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> executorServiceRef </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> Reference to lookup a <tt>executorService</tt> in the <a shape="rect" href="registry.html" title="Registry">Registry</a> </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> timeoutCheckerExecutorService </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.9:</b> If using either of the <tt>completionTimeout</tt>, <tt>completionTimeoutExpression</tt>, or <tt>completionInterval</tt> options a background thread is created to check for the completion for every aggregator. Set this option to provide a custom thread pool to be used rather than creating a new thread for every aggregator. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> timeoutCheckerExecutorServiceRef </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.9:</b> Reference to lookup a <tt>timeoutCheckerExecutorService</tt> in the <a shape="rect" href="regis try.html" title="Registry">Registry</a> </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> optimisticLocking </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> Turns on using optimistic locking, which requires the <tt>aggregationRepository</tt> being used, is supporting this by implementing the <tt>org.apache.camel.spi.OptimisticLockingAggregationRepository</tt> interface. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> optimisticLockRetryPolicy </td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11.1:</b> Allows to configure retry settings when using optimistic locking. </td></tr></tbody></table> </div> </div> @@ -2685,6 +2685,39 @@ public final class MyListOfNumbersStrate </div></div> +<h3><a shape="rect" name="BookPatternAppendix-UsingGroupedExchanges"></a>Using GroupedExchanges</h3> + +<p>In the route below we group all the exchanges together using <tt>groupExchanges()</tt>:</p> +<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ + from("direct:start") + // aggregate all using same expression + .aggregate(constant(true)) + // wait for 0.5 seconds to aggregate + .completionTimeout(500L) + // group the exchanges so we get one single exchange containing all the others + .groupExchanges() + .to("mock:result"); +]]></script> +</div></div> + +<p>As a result we have one outgoing <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> being routed the the "mock:result" endpoint. The exchange is a holder containing all the incoming Exchanges.<br clear="none"> +To get access to these exchanges you need to access them from a property on the outgoing exchange as shown:</p> +<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ +List<Exchange> grouped = out.getProperty(Exchange.GROUPED_EXCHANGE, List.class); +]]></script> +</div></div> + +<p>From <b>Camel 2.13</b> onwards this behavior has changed to store these exchanges directly on the message body which is more intuitive:</p> +<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ +List<Exchange> grouped = exchange.getIn().getBody(List.class); +]]></script> +</div></div> + +<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1">Notice the old way using the property is still present in <b>Camel 2.13</b> onwards, but its considered deprecated and to be removed in Camel 3.0 onwards.</td></tr></table></div> + <h3><a shape="rect" name="BookPatternAppendix-UsingPOJOsasAggregationStrategy"></a>Using POJOs as AggregationStrategy</h3> <p><b>Available as of Camel 2.12</b></p>
Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/camel-2130-release.html ============================================================================== --- websites/production/camel/content/camel-2130-release.html (original) +++ websites/production/camel/content/camel-2130-release.html Fri Sep 13 11:20:17 2013 @@ -136,7 +136,7 @@ <h2><a shape="rect" name="Camel2.13.0Release-Importantchangestoconsiderwhenupgrading"></a>Important changes to consider when upgrading</h2> -<ul><li>TODO</li></ul> +<ul><li>If using <tt>groupedExchanges</tt> option on <a shape="rect" href="aggregator2.html" title="Aggregator2">Aggregate</a> EIP then the <a shape="rect" href="exchange.html" title="Exchange">Exchange</a>s is now stored on the message body as well. The old way of storing as a property is considered deprecated. See more details at <a shape="rect" href="aggregator2.html" title="Aggregator2">Aggregate</a>.</li></ul> <h2><a shape="rect" name="Camel2.13.0Release-GettingtheDistributions"></a>Getting the Distributions</h2>