Class GroupedExchangeAggregationStrategy
java.lang.Object
org.apache.camel.processor.aggregate.AbstractListAggregationStrategy<org.apache.camel.Exchange>
org.apache.camel.processor.aggregate.GroupedExchangeAggregationStrategy
- All Implemented Interfaces:
org.apache.camel.AggregationStrategy
@Metadata(label="bean",
description="Aggregate all Exchanges into a single combined Exchange holding all the aggregated exchanges in a List of Exchange as the message body. This aggregation strategy can be used in combination with Splitter to batch messages.",
annotations="interfaceName=org.apache.camel.AggregationStrategy")
@Configurer(metadataOnly=true)
public class GroupedExchangeAggregationStrategy
extends AbstractListAggregationStrategy<org.apache.camel.Exchange>
Aggregate all exchanges into a single combined Exchange holding all the aggregated exchanges in a
List of
Exchange as the message body.
Important: This strategy is not to be used with the
Content Enricher EIP which is enrich or pollEnrich.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.Exchangeaggregate(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange) This method will aggregate the old and new exchange and return the result.org.apache.camel.ExchangegetValue(org.apache.camel.Exchange exchange) This method is implemented by the sub-class and is called to retrieve an instance of the value that will be aggregated and forwarded to the receiving end point.Methods inherited from class org.apache.camel.processor.aggregate.AbstractListAggregationStrategy
isStoreAsBodyOnCompletion, onCompletionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.AggregationStrategy
aggregate, canPreComplete, onCompletion, onOptimisticLockFailure, preComplete, timeout
-
Constructor Details
-
GroupedExchangeAggregationStrategy
public GroupedExchangeAggregationStrategy()
-
-
Method Details
-
aggregate
public org.apache.camel.Exchange aggregate(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange) Description copied from class:AbstractListAggregationStrategyThis method will aggregate the old and new exchange and return the result.- Specified by:
aggregatein interfaceorg.apache.camel.AggregationStrategy- Overrides:
aggregatein classAbstractListAggregationStrategy<org.apache.camel.Exchange>- Parameters:
oldExchange- The oldest exchange, can be nullnewExchange- The newest exchange, can be null- Returns:
- a composite exchange of the old and/or new exchanges
-
getValue
public org.apache.camel.Exchange getValue(org.apache.camel.Exchange exchange) Description copied from class:AbstractListAggregationStrategyThis method is implemented by the sub-class and is called to retrieve an instance of the value that will be aggregated and forwarded to the receiving end point. If null is returned, then the value is not added to theList.- Specified by:
getValuein classAbstractListAggregationStrategy<org.apache.camel.Exchange>- Parameters:
exchange- The exchange that is used to retrieve the value from- Returns:
- An instance of V that is the associated value of the passed exchange
-