SpringSource/spring-amqp — pull request #62 by garyrussell (2012-07-19 19:27:57+00:00)
Title: AMQP-254 Add MessageId Advice

The RetryInterceptor requires messages to have an Id. It does not
work in an environent where some messages have an Id and some don't.

This adds an advice to enhance incoming messages with an id if it is
missing. Such messages cannot participate in the normal retry logic
(backoff policy etc), but allows 1 retry (until the redelivered
header is set). For a redelivered message without an Id, that fails,
the advice throws an AmqpRejectAndDontRequeueException, signaling the
container to tell the broker to stop delivering the message.

The broker can be configured to forward such messages to the Dead
Letter Exchange.

Add tests to verify messages with and without Ids use the
appropriated retry mechanism.

Also adds a RejectAndDontRequeueRecoverer. The default
MessageRecoverer simply eats the failed message; this recoverer
throws the message back to the broker enabling DLE/DLQ processing.