org.apache.camel.processor.aggregate
Class UseLatestAggregationStrategy
java.lang.Object
org.apache.camel.processor.aggregate.UseLatestAggregationStrategy
- All Implemented Interfaces:
- AggregationStrategy
public class UseLatestAggregationStrategy
- extends Object
- implements AggregationStrategy
An AggregationStrategy
which just uses the latest exchange which is useful
for status messages where old status messages have no real value. Another example is things
like market data prices, where old stock prices are not that relevant, only the current price is.
- Version:
UseLatestAggregationStrategy
public UseLatestAggregationStrategy()
aggregate
public Exchange aggregate(Exchange oldExchange,
Exchange newExchange)
- Description copied from interface:
AggregationStrategy
- Aggregates an old and new exchange together to create a single combined exchange
- Specified by:
aggregate
in interface AggregationStrategy
- Parameters:
oldExchange
- the oldest exchange (is null on first aggregation as we only have the new exchange)newExchange
- the newest exchange (can be null if there was no data possible to acquire)
- Returns:
- a combined composite of the two exchanges
propagateException
protected void propagateException(Exchange oldExchange,
Exchange newExchange)
propagateFailure
protected Exchange propagateFailure(Exchange oldExchange,
Exchange newExchange)
toString
public String toString()
- Overrides:
toString
in class Object
Apache CAMEL