Package org.apache.camel.spi
Interface RecoverableAggregationRepository
-
- All Superinterfaces:
AggregationRepository
public interface RecoverableAggregationRepository extends AggregationRepository
A specializedAggregationRepositorywhich also supports recovery. This usually requires a repository which is persisted.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanconfirmWithResult(CamelContext camelContext, String exchangeId)Confirms the completion of theExchangewith a result.StringgetDeadLetterUri()Gets the dead letter channelintgetMaximumRedeliveries()Gets the maximum redelivery attempts to do before a recoveredExchangeis doomed as exhausted and moved to the dead letter channel.longgetRecoveryIntervalInMillis()Gets the interval between recovery scans in millis.booleanisUseRecovery()Whether or not recovery is enabled or notExchangerecover(CamelContext camelContext, String exchangeId)Recovers the exchange with the given exchange idSet<String>scan(CamelContext camelContext)Scans the repository forExchanges to be recoveredvoidsetDeadLetterUri(String deadLetterUri)Sets an optional dead letter channel which exhausted recoveredExchangeshould be send to.voidsetMaximumRedeliveries(int maximumRedeliveries)Sets an optional limit of the number of redelivery attempt of recoveredExchangeshould be attempted, before its exhausted.voidsetRecoveryInterval(long interval)Sets the interval between recovery scansvoidsetRecoveryInterval(long interval, TimeUnit timeUnit)Sets the interval between recovery scansvoidsetUseRecovery(boolean useRecovery)Sets whether or not recovery is enabled
-
-
-
Method Detail
-
scan
Set<String> scan(CamelContext camelContext)
Scans the repository forExchanges to be recovered- Parameters:
camelContext- the current CamelContext- Returns:
- the exchange ids for to be recovered
-
recover
Exchange recover(CamelContext camelContext, String exchangeId)
Recovers the exchange with the given exchange id- Parameters:
camelContext- the current CamelContextexchangeId- exchange id- Returns:
- the recovered exchange or null if not found
-
setRecoveryInterval
void setRecoveryInterval(long interval, TimeUnit timeUnit)Sets the interval between recovery scans- Parameters:
interval- the intervaltimeUnit- the time unit
-
setRecoveryInterval
void setRecoveryInterval(long interval)
Sets the interval between recovery scans- Parameters:
interval- the interval in millis
-
getRecoveryIntervalInMillis
long getRecoveryIntervalInMillis()
Gets the interval between recovery scans in millis.- Returns:
- the interval in millis
-
setUseRecovery
void setUseRecovery(boolean useRecovery)
Sets whether or not recovery is enabled- Parameters:
useRecovery- whether or not recovery is enabled
-
isUseRecovery
boolean isUseRecovery()
Whether or not recovery is enabled or not- Returns:
- true to use recovery, false otherwise.
-
setDeadLetterUri
void setDeadLetterUri(String deadLetterUri)
Sets an optional dead letter channel which exhausted recoveredExchangeshould be send to. By default this option is disabled- Parameters:
deadLetterUri- the uri of the dead letter channel
-
getDeadLetterUri
String getDeadLetterUri()
Gets the dead letter channel- Returns:
- the uri of the dead letter channel
-
setMaximumRedeliveries
void setMaximumRedeliveries(int maximumRedeliveries)
Sets an optional limit of the number of redelivery attempt of recoveredExchangeshould be attempted, before its exhausted. When this limit is hit, then theExchangeis moved to the dead letter channel. By default this option is disabled- Parameters:
maximumRedeliveries- the maximum redeliveries
-
getMaximumRedeliveries
int getMaximumRedeliveries()
Gets the maximum redelivery attempts to do before a recoveredExchangeis doomed as exhausted and moved to the dead letter channel.- Returns:
- the maximum redeliveries
-
confirmWithResult
default boolean confirmWithResult(CamelContext camelContext, String exchangeId)
Confirms the completion of theExchangewith a result. This method is invoked instead of confirm() if the repository is recoverable. This allows possible recovery of non-confirmed completed exchanges.- Parameters:
camelContext- the current CamelContextexchangeId- exchange id to confirm- Returns:
- true if the exchange was successfully removed, else false.
-
-