How to reprocess messages from an SQS dead-letter queue?

DVA-C02 By islever Editorial Last updated

Short answer

C Use the StartMessageMoveTask API to move messages from the dead-letter queue to the original SQS queue.

Question

A company has an application that uses an AWS Lambda function to consume messages from an Amazon Simple Queue Service (Amazon SQS) queue. The SQS queue is configured with a dead-letter queue. Due to a defect in the application, AWS Lambda failed to process some messages. A developer fixed the bug and wants to process the failed messages again. How should the developer resolve this issue?
  1. Use the SendMessageBatch API to send messages from the dead-letter queue to the original SQS queue.
  2. Use the ChangeMessageVisibility API to configure messages in the dead-letter queue to be visible in the original SQS queue.
  3. Use the StartMessageMoveTask API to move messages from the dead-letter queue to the original SQS queue. Correct Answer
  4. Use the PurgeQueue API to remove messages from the dead-letter queue and return the messages to the original SQS queue.

Key Takeaways

This question tests the specific API used for redriving messages from a DLQ; the trap is confusing message visibility settings with inter-queue message movement.

To reprocess failed messages from an Amazon SQS dead-letter queue (DLQ), developers should utilize the StartMessageMoveTask API. The community consensus confirms this is the most efficient method for redriving messages back to the original queue.

Common mistake: Choosing `ChangeMessageVisibility` is a frequent error because it sounds like it makes messages available, but it only adjusts the timeout within the same queue rather than moving them.

Expert Analysis

Why the Answer Is Correct

The StartMessageMoveTask API is the designated AWS method for moving messages from a dead-letter queue (DLQ) back to the original source queue. It efficiently handles the transfer while preserving message attributes and metadata, allowing the fixed Lambda function to reprocess them correctly.

Why the Other Options Are Wrong

SendMessageBatch requires manually retrieving messages from the DLQ and sending them again, which is inefficient and more complex than the native move task. ChangeMessageVisibility only alters the timeout for a message within the same queue and does not transfer it to another. PurgeQueue permanently deletes messages from the DLQ and does not return them to the source queue.

Community Comment Notes

Community members strongly support Option C, noting that this API is specifically designed for moving messages between queues, including from a DLQ. Comments emphasize the efficiency of this method compared to manual alternatives.

Official Reference

https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_StartMessageMoveTask.html

This link opens the official vendor documentation in a new tab.

Exam Strategy

When facing questions about SQS dead-letter queues, look for specific 'Move' or 'Redrive' APIs rather than generic send or visibility commands. Remember that purging a queue permanently deletes data and cannot be used to recover messages.

Community Votes

C
100%

100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 3 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 3

  1. gdm83 👍 1
    C StartMessageMoveTask: This API is specifically designed for moving messages between SQS queues, including moving messages from a dead-letter queue (DLQ) back to the original queue. This method is efficient and preserves message attributes and other metadata.
  2. devmo 👍 1 Answered C
    If answer is C, why does it show as A?
  3. raeIT 👍 1
    vote C

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All DVA-C02 Questions

Access 100 questions with complete answers and detailed explanations.

View Full DVA-C02 Practice Test →

← Back to DVA-C02 Study Guide