Hands-On Mini Lab

SQS Dead-Letter Queue Lab

Negligible for a few messages. Delete both queues after the lab.

Goal

Reinforce Visibility timeout, Receive count, DLQ redrive policy, Idempotent consumers through a small, inspectable activity.

Concepts Reinforced

  • Visibility timeout
  • Receive count
  • DLQ redrive policy
  • Idempotent consumers

Prerequisites

  • AWS CLI configured
  • Permission to create SQS queues

Estimated Cost

Exact Steps

  1. Create a dead-letter queue.
  2. Create a source queue.
  3. Set the source queue redrive policy to the DLQ ARN with maxReceiveCount set to 3.
  4. Send one message to the source queue.
  5. Receive the message several times without deleting it and observe eventual DLQ movement.
Runnable policy shape
{
  "deadLetterTargetArn": "arn:aws:sqs:us-east-1:111122223333:djames-study-dlq",
  "maxReceiveCount": "3"
}

Verification

  • The source queue redrive policy references the DLQ ARN.
  • The DLQ eventually has the failed message after repeated receives and visibility timeouts.

Cleanup Steps

  • Purge and delete the source queue.
  • Purge and delete the DLQ.

Sources and Review Metadata

This independent training application is not affiliated with or endorsed by Amazon Web Services. AWS, Amazon Web Services, and AWS certification names are trademarks of Amazon.com, Inc. or its affiliates.