Interface MessageBusExceptionHandler
-
- All Known Implementing Classes:
ErrorListenerDelegatingMessageBusExceptionHandler,ErrorThrowingMessageBusExceptionHandler
public interface MessageBusExceptionHandlerWhenever anExceptionoccurs during the delivering of a message on aMessageBus, theMessageBusExceptionHandleris invoked with the message and the exception.- See Also:
- EventMaid Documentation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidcallTemporaryExceptionListener(ProcessingContext<Object> message, Exception e, List<MessageBusExceptionListener> listeners)For each exception, this method is responsible to call the dynamically addedMessageBusExceptionListener.voidhandleDeliveryChannelException(ProcessingContext<Object> message, Exception e, Channel<Object> channel)For eachExceptionthrown inside aSubscriber, for whichMessageBusExceptionHandler.shouldDeliveryChannelErrorBeHandledAndDeliveryAbortedreturnedtrue, this method is invoked.voidhandleFilterException(ProcessingContext<Object> message, Exception e, Channel<Object> channel)When aExceptioninside aFilteris thrown, this method is invoked.booleanshouldDeliveryChannelErrorBeHandledAndDeliveryAborted(ProcessingContext<Object> message, Exception e, Channel<Object> channel)In some cases, anExceptionduring the delivery to aSubscribershould be ignored, so that the delivery is not stopped.
-
-
-
Method Detail
-
shouldDeliveryChannelErrorBeHandledAndDeliveryAborted
boolean shouldDeliveryChannelErrorBeHandledAndDeliveryAborted(ProcessingContext<Object> message, Exception e, Channel<Object> channel)
In some cases, anExceptionduring the delivery to aSubscribershould be ignored, so that the delivery is not stopped. Therefore for each exception during the delivery this method is invoked. Iftrueis returned, the delivery stopped, theMessageBusExceptionHandler.handleDeliveryChannelExceptionmethod is invoked and the message is marked as failed inChannelStatistics. Iffalseis returned, the exception is ignored and the delivery continues.- Parameters:
message- the message for which theExceptionwas throwne- the raisedExceptionchannel- theEventTypespecific channel, in which the message was delivered- Returns:
trueif the exception should be handled,falseotherwise
-
handleDeliveryChannelException
void handleDeliveryChannelException(ProcessingContext<Object> message, Exception e, Channel<Object> channel)
For eachExceptionthrown inside aSubscriber, for whichMessageBusExceptionHandler.shouldDeliveryChannelErrorBeHandledAndDeliveryAbortedreturnedtrue, this method is invoked.- Parameters:
message- the message, which caused theExceptione- the raisedExceptionchannel- the deliveryChannel
-
handleFilterException
void handleFilterException(ProcessingContext<Object> message, Exception e, Channel<Object> channel)
When aExceptioninside aFilteris thrown, this method is invoked.- Parameters:
message- the message that caused theExceptione- the raisedExceptionchannel- the acceptingChannel
-
callTemporaryExceptionListener
default void callTemporaryExceptionListener(ProcessingContext<Object> message, Exception e, List<MessageBusExceptionListener> listeners)
For each exception, this method is responsible to call the dynamically addedMessageBusExceptionListener.- Parameters:
message- the message that caused theExceptione- the raisedExceptionlisteners- all interestedMessageBusExceptionListener
-
-