All Products
Search
Document Center

ApsaraMQ for RocketMQ:Dead-letter queues

Last Updated:Mar 11, 2026

When a consumer fails to process a message after the maximum number of retries, ApsaraMQ for RocketMQ moves the message to a dead-letter queue. Dead-letter messages typically indicate a consumer bug, a downstream dependency failure, or an incompatible message format. After you fix the root cause, resend the messages from the console for reprocessing. If you cannot resolve the issue immediately, export the messages to prevent data loss before the 3-day retention period expires. For more information about retry behavior, see Message retry.

Key characteristics

CharacteristicDetails
ScopeEach dead-letter queue belongs to a consumer group, not an individual consumer instance. All dead-letter messages from the same group land in the same queue, regardless of the original topic.
CreationCreated on demand. No dead-letter queue exists for a group until that group produces a dead-letter message.
RetentionDead-letter messages expire after 3 days (the same retention period as normal messages). Expired messages are automatically deleted.
Normal deliveryDead-letter messages cannot be consumed through normal delivery. Resend them from the console after you fix the issue.

Diagnose dead-letter messages

When messages appear in a dead-letter queue, investigate the root cause before resending:

  1. Check consumer logs for exceptions or errors during message processing.

  2. Inspect the message content -- query the message by ID and review its body and properties to identify malformed or unexpected data.

  3. Verify downstream dependencies -- confirm that databases, APIs, or other services the consumer relies on were available when the failure occurred.

  4. Review consumer timeout settings -- make sure the consumer has enough time to process messages before they time out and trigger a retry.

Query dead-letter messages

ApsaraMQ for RocketMQ provides two query methods in the console:

MethodInputMatch typeBest for
By group IDGroup ID + time rangeRange matchBrowsing all dead-letter messages in a time window
By message IDGroup ID + message IDExact matchLocating a specific message

Steps

  1. Log on to the ApsaraMQ for RocketMQ console. In the left-side navigation pane, click Instances.

  2. In the top navigation bar, select a region, such as China (Hangzhou). On the Instances page, click the name of the instance that you want to manage.

  3. In the left-side navigation pane, click Dead-letter Queues.

  4. On the Dead-letter Queues page, select a query method:

    • Query by Group ID -- Specify a group ID and a time range to retrieve all matching dead-letter messages.

      Note

      The generation time of a dead-letter message is when the message entered the dead-letter queue after exhausting all retries, not when it was originally sent.

    • Query by Message ID -- Specify a group ID and a message ID to locate a specific message.

Resend dead-letter messages

After you identify and fix the root cause, resend dead-letter messages from the console to retry consumption.

Important
  • Ordered messages cannot be resent from a dead-letter queue. Export them and process them manually.

  • Resent messages remain stored in the dead-letter queue and are automatically deleted after the retention period expires.

Resend a single message

  1. Query the dead-letter message using either method above.

  2. In the message list, find the target message and click More in the Actions column.

  3. Select Resend.

Resend multiple messages

  1. Query dead-letter messages by group ID.

  2. Select the messages to resend.

  3. Click Batch Resend Messages.

Export dead-letter messages

Export messages to preserve them before the 3-day retention period expires. Exported files are in CSV format.

Export a single message

  1. Query the dead-letter message using either method above.

  2. In the message list, find the target message and click More in the Actions column.

  3. Select Export Message.

Export multiple messages

  1. Query dead-letter messages by group ID.

  2. Select the messages to export.

  3. Click Batch Export Messages.

Exported fields

FieldDescription
instanceIdInstance ID
topicTopic the message belongs to
msgIdMessage ID
bornHostURL of the producer that produced the message
bornTimestampTimestamp when the message was produced
storeTimestampTimestamp when the broker stored the message
reconsumeTimesNumber of failed consumption attempts
propertiesMessage attributes in JSON format
bodyMessage body, Base64-encoded
bodyCRCCRC (Cyclic Redundancy Check) value of the message body

What to do next

  • Message retry -- Learn how retry intervals and maximum retry counts determine when a message becomes a dead-letter message.