Package com.lmax.disruptor
Class EventuallyGiveUpBatchRewindStrategy
java.lang.Object
com.lmax.disruptor.EventuallyGiveUpBatchRewindStrategy
- All Implemented Interfaces:
BatchRewindStrategy
Strategy for handling a rewindableException that will eventually delegate the exception to the
ExceptionHandler after a specified number of attempts have been made.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleRewindException(RewindableException e, int retriesAttempted) When aRewindableExceptionis thrown, this will be called.
-
Field Details
-
maxAttempts
private final long maxAttempts
-
-
Constructor Details
-
EventuallyGiveUpBatchRewindStrategy
public EventuallyGiveUpBatchRewindStrategy(long maxAttempts) - Parameters:
maxAttempts- numbers of Rewindable exceptions that can be thrown until exception is delegated
-
-
Method Details
-
handleRewindException
Description copied from interface:BatchRewindStrategyWhen aRewindableExceptionis thrown, this will be called.- Specified by:
handleRewindExceptionin interfaceBatchRewindStrategy- Parameters:
e- the exception that propagated from theEventHandler.retriesAttempted- how many attempts there have been for the batch- Returns:
- the decision of whether to rewind the batch or throw the exception
-