Package org.axonframework.messaging.core
Interface MessageHandlingExceptionHandler<M extends Message>
- Type Parameters:
M- the type of message being handled
- All Known Subinterfaces:
CommandHandlingExceptionHandler,EventHandlingExceptionHandler,QueryHandlingExceptionHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Handles exceptions thrown by a message handler.
Return MessageStream.empty() to suppress the exception. Return MessageStream.failed(Throwable) (with
the same or a different exception) to let the error propagate to the message processor.
- Since:
- 5.2.0
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionMessageStream<? extends Message> handle(M message, ProcessingContext context, Throwable error) Called when a message handler throws an exception.
-
Method Details
-
handle
Called when a message handler throws an exception.- Parameters:
message- the message being handled when the exception occurredcontext- the active processing contexterror- the exception thrown by the message handler- Returns:
MessageStream.empty()to suppress the error, orMessageStream.failed(Throwable)to propagate it
-