spring-projects/spring-amqp — pull request #180 by garyrussell (2014-04-21 15:41:58+00:00)
Title: AMQP-390 Add ConditionalRejectingErrorHandler

JIRA: https://jira.spring.io/browse/AMQP-390

Fatal conversion errors (e.g. invalid content-encoding)
cause an endless loop by default.

Add a `ConditionalRejectingErrorHandler` that detects this problem
and wraps the exception in an `AmqpRejectAndDontRequeueException`
so the container will reject the message with requeue=false.

Make this the default `ErrorHandler`.

Add a strategy interface allowing customization of the algorithm
deciding which exceptions need to be wrapped. Exceptions that
already have an `AmqpRejectAndDontRqueueException` will not be
wrapped because those messages will already be handled that
way by the container.

Add the failed message to the `ListenerExecutionFailedException`
so that it is available to the `FatalExceptionStrategy`
implementation.