Package org.axonframework.eventhandling
Interface ListenerInvocationErrorHandler
- All Known Implementing Classes:
LoggingErrorHandler,PropagatingErrorHandler
public interface ListenerInvocationErrorHandler
Interface of an error handler that is invoked when an exception is triggered as result of an
EventMessageHandler handling an event.- Author:
- Rene de Waele
-
Method Summary
Modifier and TypeMethodDescriptionvoidonError(Exception exception, EventMessage<?> event, EventMessageHandler eventHandler) Invoked after giveneventListenerfailed to handle givenevent.
-
Method Details
-
onError
void onError(@Nonnull Exception exception, @Nonnull EventMessage<?> event, @Nonnull EventMessageHandler eventHandler) throws Exception Invoked after giveneventListenerfailed to handle givenevent. Implementations have a choice of options for how to continue:- To ignore this error no special action is required. Processing will continue for this and subsequent events.
- To retry processing the event, implementations can re-invoke
EventMessageHandler.handle(EventMessage)on the eventListener once or multiple times. - To terminate event handling altogether and stop propagating the event to other listeners implementations may throw an exception.
- Parameters:
exception- The exception thrown by the given eventListenerevent- The event that triggered the exceptioneventHandler- The listener that failed to handle given event- Throws:
Exception- To stop further handling of the event
-