public class ConditionalRejectingErrorHandler
extends java.lang.Object
implements org.springframework.util.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 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. |
| Modifier and Type | Method and Description |
|---|---|
void |
handleError(java.lang.Throwable t) |
public ConditionalRejectingErrorHandler()
ConditionalRejectingErrorHandler.DefaultExceptionStrategy.public ConditionalRejectingErrorHandler(FatalExceptionStrategy exceptionStrategy)
FatalExceptionStrategy implementation.exceptionStrategy - The strategy implementation.