#75 states that we do retry. However in the current code base we currently deadletter the messages immediately without doing retries ( checking delivery count etc). Looks like some of the code went missing ( possibly when merge happened?)
// TODO: exception between these two?
// TODO: retries, retry count, Abandon vs DeadLetter?
// Just: if (args.Message.DeliveryCount > 5) ?
if (args.Message.DeliveryCount > 5)
// dead letter.
Dead-letter messages only after 5 attempts to process. #199
The correct way to do this is to
1. to abandon the message before the max delivery count is exceeded. ( separate bug on this).
2. it should be possible to set the MaxDeliveryCount on SubscriptionDescription http://msdn.microsoft.com/en-us/library/windowsazure/hh780763.aspx instead of explicily dead lettering the messages.
If we set maxdeliverycount to 5 when we create the subscription, as per the service bus documentation, aftter 5 times the message will be deadlettered by the infrastructure.
Assuming things work the way its documented- the choice of whether to explicity check deliverycount and dead letter the message would depend on whether we want to do some thing extra (like set error description etc on the message before we explicity deadletter the message).
Regarding abandoning the message- just updated the other bug on this.