MassTransit/MassTransit — Issue #84: Use of RetryLater on Exception can cause message to retry indefinitely
Author: lowds
Created: 2012-02-03 14:05:16+00:00
State: open

Using LocalBus.MessageContext().RetryLater() will cause the message to be added back to the queue with the RetryCount incremented but with a brand new MessageId value.

When receiving the message in Endpoint.cs the MessageRetryTracker is queried to see if the message has exceeded the maximun retry limit, however because the message has been added to the queue with a new MessageId the IsRetryLimitExceeded method of the MessageRetryTracker always returns false.

This can lead to a message being stuck on the queue indefinitely in the case where there is a message processing error that cannot be resolved.