public class RetryingErrorHandler extends Object implements ErrorHandler
| Modifier and Type | Class and Description |
|---|---|
static class |
RetryingErrorHandler.TimeoutConfiguration
Definition of a timeout to use for a specific range of retries
|
| Constructor and Description |
|---|
RetryingErrorHandler()
Initialize an instance of the RetryingErrorHandler that indefinitely retries each 2 seconds.
|
RetryingErrorHandler(RetryingErrorHandler.TimeoutConfiguration... timeoutConfigurations)
Initialize an instance of the RetryingErrorHandler that uses the given
TimeoutConfigurations that
describe which retry timeout should be used for each number of retries. |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isTransient(Throwable exception)
Indicates whether the given
exception is transient (i.e. |
RetryPolicy |
onErrorInvoking(Saga saga,
EventMessage publishedEvent,
int invocationCount,
Exception e)
Invoked when an error occurs when a Saga instance is invoked.
|
RetryPolicy |
onErrorPreparing(Class<? extends Saga> sagaType,
EventMessage<?> publishedEvent,
int invocationCount,
Exception e)
Invoked when an error occurs preparing Sagas.
|
public RetryingErrorHandler()
public RetryingErrorHandler(RetryingErrorHandler.TimeoutConfiguration... timeoutConfigurations)
TimeoutConfigurations that
describe which retry timeout should be used for each number of retries.timeoutConfigurations - The definitions of the timeouts to apply to each retrypublic RetryPolicy onErrorPreparing(Class<? extends Saga> sagaType, EventMessage<?> publishedEvent, int invocationCount, Exception e)
ErrorHandleronErrorPreparing in interface ErrorHandlersagaType - The type of Saga to preparepublishedEvent - The event being publishedinvocationCount - The number of attempts to prepare (is always at least 1)e - The exception that occurred in this attemptpublic RetryPolicy onErrorInvoking(Saga saga, EventMessage publishedEvent, int invocationCount, Exception e)
ErrorHandleronErrorInvoking in interface ErrorHandlersaga - The Saga instance being invokedpublishedEvent - The event handled by the SagainvocationCount - The number of times this event has been offered to the Saga, including the last, failed,
attempte - The exception that occurred in the last attempt to invoke the Sagaprotected boolean isTransient(Throwable exception)
exception is transient (i.e. could produce a different result when
retried). Exceptions that are non-transient will not be eligible for a retry.
This implementation will check if the exception or one of its causes is an instance of AxonNonTransientException.exception - The exception to inspecttrue if the exception is transient, otherwise false.Copyright © 2010-2015. All Rights Reserved.