Interface EventHandlingExceptionHandler
- All Superinterfaces:
MessageHandlingExceptionHandler<EventMessage>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface EventHandlingExceptionHandler
extends MessageHandlingExceptionHandler<EventMessage>
Handles exceptions thrown by an
EventHandler within an EventHandlingComponent.
Return MessageStream.empty() to suppress the exception — event processing continues as if no error occurred.
Return MessageStream.failed(Throwable) (with the same or a different exception) to let the error propagate
to the event processor.
Register via
EventHandlingComponentsConfigurer.CompletePhase.withExceptionHandler(org.axonframework.common.configuration.ComponentBuilder).
- Since:
- 5.2.0
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionhandle(EventMessage event, ProcessingContext context, Throwable error) Called when an event handler throws an exception.
-
Method Details
-
handle
Called when an event handler throws an exception.- Specified by:
handlein interfaceMessageHandlingExceptionHandler<EventMessage>- Parameters:
event- the event being handled when the exception occurredcontext- the active processing contexterror- the exception thrown by the event handler- Returns:
MessageStream.empty()to suppress the error, orMessageStream.failed(Throwable)to propagate it
-