public class UseLatestAggregationStrategy extends Object implements AggregationStrategy
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.Constructor and Description |
---|
UseLatestAggregationStrategy() |
Modifier and Type | Method and Description |
---|---|
Exchange |
aggregate(Exchange oldExchange,
Exchange newExchange)
Aggregates an old and new exchange together to create a single combined exchange
|
protected void |
propagateException(Exchange oldExchange,
Exchange newExchange) |
protected Exchange |
propagateFailure(Exchange oldExchange,
Exchange newExchange) |
String |
toString() |
public UseLatestAggregationStrategy()
public Exchange aggregate(Exchange oldExchange, Exchange newExchange)
AggregationStrategy
aggregate
in interface AggregationStrategy
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)protected void propagateException(Exchange oldExchange, Exchange newExchange)
protected Exchange propagateFailure(Exchange oldExchange, Exchange newExchange)
Apache Camel