Class ErrorThrowingMessageBusExceptionHandler
- java.lang.Object
-
- de.quantummaid.eventmaid.messagebus.exception.ErrorThrowingMessageBusExceptionHandler
-
- All Implemented Interfaces:
MessageBusExceptionHandler
public final class ErrorThrowingMessageBusExceptionHandler extends Object implements MessageBusExceptionHandler
The defaultMessageBusExceptionHandlerimplementation, that rethrows all exceptions.
-
-
Constructor Summary
Constructors Constructor Description ErrorThrowingMessageBusExceptionHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ErrorThrowingMessageBusExceptionHandlererrorThrowingMessageBusExceptionHandler()Factory method to create a newErrorThrowingMessageBusExceptionHandler.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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.quantummaid.eventmaid.messagebus.exception.MessageBusExceptionHandler
callTemporaryExceptionListener
-
-
-
-
Method Detail
-
errorThrowingMessageBusExceptionHandler
public static ErrorThrowingMessageBusExceptionHandler errorThrowingMessageBusExceptionHandler()
Factory method to create a newErrorThrowingMessageBusExceptionHandler.- Returns:
- the new
ErrorThrowingMessageBusExceptionHandler.
-
shouldDeliveryChannelErrorBeHandledAndDeliveryAborted
public boolean shouldDeliveryChannelErrorBeHandledAndDeliveryAborted(ProcessingContext<Object> message, Exception e, Channel<Object> channel)
Description copied from interface:MessageBusExceptionHandlerIn 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.- Specified by:
shouldDeliveryChannelErrorBeHandledAndDeliveryAbortedin interfaceMessageBusExceptionHandler- 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
public void handleDeliveryChannelException(ProcessingContext<Object> message, Exception e, Channel<Object> channel)
Description copied from interface:MessageBusExceptionHandlerFor eachExceptionthrown inside aSubscriber, for whichMessageBusExceptionHandler.shouldDeliveryChannelErrorBeHandledAndDeliveryAbortedreturnedtrue, this method is invoked.- Specified by:
handleDeliveryChannelExceptionin interfaceMessageBusExceptionHandler- Parameters:
message- the message, which caused theExceptione- the raisedExceptionchannel- the deliveryChannel
-
handleFilterException
public void handleFilterException(ProcessingContext<Object> message, Exception e, Channel<Object> channel)
Description copied from interface:MessageBusExceptionHandlerWhen aExceptioninside aFilteris thrown, this method is invoked.- Specified by:
handleFilterExceptionin interfaceMessageBusExceptionHandler- Parameters:
message- the message that caused theExceptione- the raisedExceptionchannel- the acceptingChannel
-
-