An Azure service that provides cloud messaging as a service and hybrid integration.
No. Dead-letter queues in Azure Service Bus do not support time-to-live (TTL) handling in the same way as active messages.
Key behaviors from the documentation:
- Active messages (main queue/topic/subscription)
- Messages have a TTL that can be set per message or at the entity (queue/topic) level.
- When TTL expires, messages can optionally be moved to the dead-letter queue if automatic dead-lettering on expiration is enabled. Otherwise, they are dropped.
- Entity-level TTL acts as a default and a ceiling for per-message TTL.
- Messages in the dead-letter queue (DLQ)
- The DLQ is a subqueue of each queue or subscription and is not managed independently.
- Time-to-live is not observed for messages in the DLQ. Messages remain there until explicitly retrieved and completed/removed.
- There is no automatic cleanup or expiration of DLQ messages, and messages cannot be dead-lettered again from the DLQ.
Because TTL is explicitly not applied in the DLQ and there is no automatic cleanup, the same TTL handling options that apply to active messages cannot be enabled for DLQ messages. Any lifecycle management of DLQ messages (including pseudo-TTL behavior) must be implemented by custom application logic that reads and processes/removes messages from the DLQ.
References: