Learning/AWS SQS/29 — Hands-on Labs/Lab 04 — Force a redelivery
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 04 — Force a redelivery

Goal

Kill a consumer mid-processing and watch ApproximateReceiveCount climb.

Setup

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

Steps

  1. Write a consumer that receives, sleeps 60 s, then deletes
  2. Set visibility timeout to 30 s
  3. Run it; while it sleeps, start a second consumer
  4. Observe both consumers holding the same message
  5. Kill the first consumer before it deletes
  6. Receive again and read ApproximateReceiveCount

What you should observe

  • Two consumers processing the same message simultaneously — the race from Module 08
  • ApproximateReceiveCount increments on every receive, not on every failure
  • This is the exact scenario idempotency exists for

Why it happened

To be written — ties each observation back to the mechanism in 05 — The Message Lifecycle.

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