0

I am using Azure Service bus and at the moment there is a process that is sending messages that could not be delivered to a dead letter message queue. However, if after a day the message on the dead letter queue has not been re-queued I would like it to be automatically deleted from it.

According to Microsoft's documentation the messages time-to-live is not observed, so I am not sure how to purge the messages that are over a day old.

paddingtonMike
  • 1,441
  • 1
  • 21
  • 37

1 Answers1

0

The dead-letter feature is a mechanism to protect the system from an endless failing re-processing. Given messages ending up in the dead-letter queue could be valuable messages failing due to an error in the processing logic, it would be dangerous to allow Time-To-Live on the individual dead-letter queues. When you want to override the safety mechanism, you can still do it.

One way to achieve what you want is to create a queue to represent to serve as a logical centralized dead-letter queue with a TTL and forward all dead-lettered messages there. The details of the implementation are in this post. What's important to know is that by doing so, you still have the ability to return the dead-lettered messages to the failing entity (queue or subscription) for re-processing if needed.

Sean Feldman
  • 23,443
  • 7
  • 55
  • 80