Do messages in dead letter queues in Azure Service Bus expire?
I have these queue settings:
var queueDescription = new QueueDe
Sebastian your observation is correct, in that messages once placed in the DeadLetter sub-queue never expire. They will be available there forever until removed explicitly from the DeadLetter sub-queue. In the above error regarding the tooling/api it could be a refresh issue? The call to GetQueueAsync() needs to be made after the messages have been dead-lettered which is not a deterministic time, say if you had a queue with a thousand messages that were expired but that Queue was not being used (send/receive operations) then the count may still return as Active until some operations are performed.
After doing some research I stumbled over a fact I missed completely:
Messages can expire even when dead lettering is disabled.
When messages expire while dead lettering is disabled (which is the default), they'll just get deleted.
So, Microsoft's reasoning for not auto-deleting messages from the dead letter queue is probably:
If you're enabling dead lettering, you explicitly want expired message not to be thrown away but stored somewhere else (the dead letter queue) so that you can review them.