Learning/AWS SQS/29 — Hands-on Labs/Lab 05 — Configure a dead letter queue
Intermediate outline
This chapter is an outline. The curriculum, learning objectives and structure are settled; the prose, diagrams and code are still being written. What is below is the plan for the chapter, not the chapter.

Lab 05 — Configure a dead letter queue

Goal

Watch a poison message land in quarantine after exactly maxReceiveCount receives.

Setup

To be written — CLI commands and an IaC equivalent for every resource, all prefixed sqs-course-.

Steps

  1. Create a DLQ and attach a redrive policy with maxReceiveCount = 3
  2. Send a message your consumer will always reject
  3. Run a consumer that receives and never deletes
  4. Count the receives; note the move happens on the attempt after the count exceeds 3
  5. Inspect the message in the DLQ, including its receive count
  6. Set a CloudWatch alarm on DLQ depth > 0 and watch it fire
  7. Fix the consumer and redrive with StartMessageMoveTask

What you should observe

  • The move is triggered by a receive, not by a failure
  • The DLQ message retains its original attributes and receive count
  • Redrive returns it to the source queue for another try

Why it happened

To be written — ties each observation back to the mechanism in 11 — Dead Letter Queues.

Experiments to try

To be written — deliberate variations that change the outcome.

Teardown

To be written — every resource created above, in dependency order.


Back to: 29 — Hands-on Labs