public class RetryEventDeliveryExceptionHandler extends Object implements EventDeliveryExceptionHandler
| Constructor and Description |
|---|
RetryEventDeliveryExceptionHandler(EventuateClientScheduler eventuateClientScheduler)
Creates a RetryEventDeliveryExceptionHandler that uses the specified scheduler
|
| Modifier and Type | Method and Description |
|---|---|
void |
handle(EventDeliveryExceptionHandlerState state,
Throwable t,
Runnable retry,
Consumer<Throwable> fail,
Runnable ignore)
Retry after the timeout unless the max retries has been exceeded or the supplied throwable is not handled
|
boolean |
handles(Throwable t)
Returns true if this handles the throwable
|
EventDeliveryExceptionHandlerState |
makeState(Throwable t)
create the state used for handling an exception
|
RetryEventDeliveryExceptionHandler |
withExceptions(Class<? extends Throwable>... throwables)
Specifies the exceptions that this exception handler can handle
|
RetryEventDeliveryExceptionHandler |
withInfiniteRetries()
Specifies an infinite number of retries
|
RetryEventDeliveryExceptionHandler |
withMaxRetries(int numberOfRetries)
Specifies the maximum number of retries
|
RetryEventDeliveryExceptionHandler |
withRetryInterval(Duration retryInterval)
Specifies the interval between retries
|
public RetryEventDeliveryExceptionHandler(EventuateClientScheduler eventuateClientScheduler)
eventuateClientScheduler - the schedulerpublic boolean handles(Throwable t)
EventDeliveryExceptionHandlerhandles in interface EventDeliveryExceptionHandlert - the throwablepublic EventDeliveryExceptionHandlerState makeState(Throwable t)
EventDeliveryExceptionHandlermakeState in interface EventDeliveryExceptionHandlert - the throwablepublic void handle(EventDeliveryExceptionHandlerState state, Throwable t, Runnable retry, Consumer<Throwable> fail, Runnable ignore)
handle in interface EventDeliveryExceptionHandlerstate - the statet - the throwableretry - invoked asynchronously to retryfail - invoked asynchronously to failignore - Runnable@SafeVarargs public final RetryEventDeliveryExceptionHandler withExceptions(Class<? extends Throwable>... throwables)
throwables - the exceptionspublic RetryEventDeliveryExceptionHandler withMaxRetries(int numberOfRetries)
numberOfRetries - number of retries to attemptpublic RetryEventDeliveryExceptionHandler withInfiniteRetries()
public RetryEventDeliveryExceptionHandler withRetryInterval(Duration retryInterval)
retryInterval - the retry intervalCopyright © 2019. All rights reserved.