Class MessageDeliveryErrorHandlerBuilder
java.lang.Object
dk.cloudcreate.essentials.components.foundation.messaging.MessageDeliveryErrorHandlerBuilder
Builder for
MessageDeliveryErrorHandler-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalwaysRetryOn(Class<? extends Exception>... exceptions) The resultingMessageDeliveryErrorHandlerwill keep retrying message redelivery no matter how many times message handling experiences an exception for in the list ofexceptions.
It will first attempt to match directly onExceptionclass, next it will attempt to match on hierarchy (i.e.alwaysRetryOn(List<Class<? extends Exception>> exceptions) The resultingMessageDeliveryErrorHandlerwill keep retrying message redelivery no matter how many times message handling experiences an exception for in the list ofexceptions.
It will first attempt to match directly onExceptionclass, next it will attempt to match on hierarchy (i.e.build()stopRedeliveryOn(Class<? extends Exception>... exceptions) The resultingMessageDeliveryErrorHandlerwill stop message redelivery in case message handling experiences an exception for in the list ofexceptions.
It will first attempt to match directly onExceptionclass, next it will attempt to match on hierarchy (i.e.stopRedeliveryOn(List<Class<? extends Exception>> exceptions) The resultingMessageDeliveryErrorHandlerwill stop message redelivery in case message handling experiences an exception for in the list ofexceptions.
It will first attempt to match directly onExceptionclass, next it will attempt to match on hierarchy (i.e.toString()
-
Constructor Details
-
MessageDeliveryErrorHandlerBuilder
public MessageDeliveryErrorHandlerBuilder()
-
-
Method Details
-
alwaysRetryOn
@SafeVarargs public final MessageDeliveryErrorHandlerBuilder alwaysRetryOn(Class<? extends Exception>... exceptions) The resultingMessageDeliveryErrorHandlerwill keep retrying message redelivery no matter how many times message handling experiences an exception for in the list ofexceptions.
It will first attempt to match directly onExceptionclass, next it will attempt to match on hierarchy (i.e. a concrete error which is a subtype of anExceptionfound in theexceptionswill also match)- Parameters:
exceptions- the exceptions where message redelivery will be continued no matter how many times this exception occurs- Returns:
- this builder instance
-
alwaysRetryOn
public MessageDeliveryErrorHandlerBuilder alwaysRetryOn(List<Class<? extends Exception>> exceptions) The resultingMessageDeliveryErrorHandlerwill keep retrying message redelivery no matter how many times message handling experiences an exception for in the list ofexceptions.
It will first attempt to match directly onExceptionclass, next it will attempt to match on hierarchy (i.e. a concrete error which is a subtype of anExceptionfound in theexceptionswill also match)- Parameters:
exceptions- the exceptions where message redelivery will be continued no matter how many times this exception occurs- Returns:
- this builder instance
-
stopRedeliveryOn
@SafeVarargs public final MessageDeliveryErrorHandlerBuilder stopRedeliveryOn(Class<? extends Exception>... exceptions) The resultingMessageDeliveryErrorHandlerwill stop message redelivery in case message handling experiences an exception for in the list ofexceptions.
It will first attempt to match directly onExceptionclass, next it will attempt to match on hierarchy (i.e. a concrete error which is a subtype of anExceptionfound in theexceptionswill also match)- Parameters:
exceptions- the exceptions where message redelivery will be stopped and the Message will be instantly marked as a Poison-Message/Dead-Letter-Message- Returns:
- this builder instance
-
stopRedeliveryOn
public MessageDeliveryErrorHandlerBuilder stopRedeliveryOn(List<Class<? extends Exception>> exceptions) The resultingMessageDeliveryErrorHandlerwill stop message redelivery in case message handling experiences an exception for in the list ofexceptions.
It will first attempt to match directly onExceptionclass, next it will attempt to match on hierarchy (i.e. a concrete error which is a subtype of anExceptionfound in theexceptionswill also match)- Parameters:
exceptions- the exceptions where message redelivery will be stopped and the Message will be instantly marked as a Poison-Message/Dead-Letter-Message- Returns:
- this builder instance
-
toString
-
build
-