public final class ConditionalRejectingErrorHandler extends Object implements ErrorHandler
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.
The exception will not be wrapped if the cause chain already contains an
AmqpRejectAndDontRequeueException.
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
logger |
| Constructor and Description |
|---|
ConditionalRejectingErrorHandler()
Create a handler with the
ConditionalRejectingErrorHandler.DefaultExceptionStrategy. |
ConditionalRejectingErrorHandler(FatalExceptionStrategy exceptionStrategy)
Create a handler with the supplied
FatalExceptionStrategy implementation. |
public ConditionalRejectingErrorHandler()
ConditionalRejectingErrorHandler.DefaultExceptionStrategy.public ConditionalRejectingErrorHandler(FatalExceptionStrategy exceptionStrategy)
FatalExceptionStrategy implementation.exceptionStrategy - The strategy implementation.public void handleError(Throwable t)
handleError in interface ErrorHandler