Interview Prep/AWS/Route 53, CloudFront, API Gateway and Messaging

Messages keep landing in the SQS dead-letter queue even though consumers look healthy.

IntermediateTroubleshootingRoute 53, CloudFront, API Gateway and Messaging
Answer

Likely causes → Each message was received maxReceiveCount times without being deleted. Reasons: consumers crash or time out on certain payloads ("poison messages"), the visibility timeout is too short, or the code never calls DeleteMessage.

Diagnose →

aws sqs get-queue-attributes --queue-url <main-url> --attribute-names RedrivePolicy VisibilityTimeout
aws sqs receive-message --queue-url <dlq-url> --max-number-of-messages 5 \
  --attribute-names ApproximateReceiveCount --message-attribute-names All

Fix →

  1. Inspect the DLQ payloads, and fix the parser or the code path
  2. Make sure consumers delete messages only after success
  3. Once fixed, redrive: aws sqs start-message-move-task --source-arn <dlq-arn> --destination-arn <main-arn>

Prevent → Alarm on ApproximateNumberOfMessagesVisible above 0 on every DLQ, and log the message ID on failures.

aws All AWS questions Roadmap: AWS core services

More on Route 53, CloudFront, API Gateway and Messaging