This document describes the basic concept, use cases, and usage of TDMQ for CMQ dead letter queue.
A dead letter queue (DLQ) is used to process messages that cannot be consumed normally. If consumption still fails after the maximum number of retries, it indicates that the consumer cannot consume a message under normal circumstances. At this point, TDMQ for CMQ will not immediately discard the message; instead, it will send the message to a special queue of the consumer, i.e., DLQ. You can enable DLQ for both new and existing queues.
Issue location: for example, if a message is not deleted after being consumed multiple times, this is generally because the message is not consumed properly, and there may be an issue which you should identify. You can set the maximum number of receipts after which the message will be placed in the specified DLQ for subsequent troubleshooting.
Priority queue: for example, O2O customers such as bike sharing operators have high requirements for access latency and real-timeness. In the bike unlocking logic, after TDMQ for CMQ retains 100 million messages, it will process the latest messages first and place old ones in the DLQ for consumption when the consumer is capable of consuming them.
As users may have been lost while old messages are waiting (such as bike unlocking through QR code scan), the value of old messages is low; therefore, we recommend processing the latest messages first.
When creating a queue in the TDMQ for CMQ console, you can enable the DLQ feature.
DLQ Queue Name: specify a queue as the DLQ of the queue.
Dead Letter Policy: select the method of triggering dead letter messages.