Package org.apache.camel.spi
Interface AggregationRepository
-
- All Known Subinterfaces:
OptimisticLockingAggregationRepository
,RecoverableAggregationRepository
public interface AggregationRepository
Access to a repository to store aggregated exchanges to support pluggable implementations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Exchange
add(CamelContext camelContext, String key, Exchange exchange)
Add the givenExchange
under the correlation key.void
confirm(CamelContext camelContext, String exchangeId)
Confirms the completion of theExchange
.Exchange
get(CamelContext camelContext, String key)
Gets the given exchange with the correlation keySet<String>
getKeys()
Gets the keys currently in the repository.void
remove(CamelContext camelContext, String key, Exchange exchange)
Removes the exchange with the given correlation key, which should happen when anExchange
is completed
-
-
-
Method Detail
-
add
Exchange add(CamelContext camelContext, String key, Exchange exchange)
Add the givenExchange
under the correlation key. Will replace any existing exchange. Important: This method is not invoked if only one exchange was completed, and therefore the exchange does not need to be added to a repository, as its completed immediately.- Parameters:
camelContext
- the current CamelContextkey
- the correlation keyexchange
- the aggregated exchange- Returns:
- the old exchange if any existed
-
get
Exchange get(CamelContext camelContext, String key)
Gets the given exchange with the correlation key This method is always invoked for any incoming exchange in the aggregator.- Parameters:
camelContext
- the current CamelContextkey
- the correlation key- Returns:
- the exchange, or null if no exchange was previously added
-
remove
void remove(CamelContext camelContext, String key, Exchange exchange)
Removes the exchange with the given correlation key, which should happen when anExchange
is completed Important: This method is not invoked if only one exchange was completed, and therefore the exchange does not need to be added to a repository, as its completed immediately.- Parameters:
camelContext
- the current CamelContextkey
- the correlation keyexchange
- the exchange to remove
-
confirm
void confirm(CamelContext camelContext, String exchangeId)
Confirms the completion of theExchange
. This method is always invoked.- Parameters:
camelContext
- the current CamelContextexchangeId
- exchange id to confirm
-
-