Class ConditionalRejectingErrorHandler

java.lang.Object
org.springframework.amqp.listener.ConditionalRejectingErrorHandler
org.springframework.amqp.rabbit.listener.ConditionalRejectingErrorHandler
All Implemented Interfaces:
ErrorHandler

@Deprecated(forRemoval=true, since="4.1") public class ConditionalRejectingErrorHandler extends ConditionalRejectingErrorHandler
Deprecated, for removal: This API element is subject to removal in a future version.
ErrorHandler that conditionally wraps the Exception in an AmqpRejectAndDontRequeueException if the configured rejection strategy determines that the message is fatal and should not be requeued. Such messages will be discarded or sent to a Dead Letter Exchange, depending on broker configuration.

The default strategy will do this if the exception is a ListenerExecutionFailedException with a cause of MessageConversionException, MessageConversionException, MethodArgumentNotValidException, MethodArgumentTypeMismatchException, NoSuchMethodException or ClassCastException.

The exception will not be wrapped if the cause chain already contains an AmqpRejectAndDontRequeueException.

Since:
1.3.2
Author:
Gary Russell, Ngoc Nhan
  • Constructor Details

    • ConditionalRejectingErrorHandler

      public ConditionalRejectingErrorHandler()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • ConditionalRejectingErrorHandler

      public ConditionalRejectingErrorHandler(FatalExceptionStrategy exceptionStrategy)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a handler with the supplied FatalExceptionStrategy implementation.
      Parameters:
      exceptionStrategy - The strategy implementation.