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
- Write a consumer that receives, sleeps 60 s, then deletes
- Set visibility timeout to 30 s
- Run it; while it sleeps, start a second consumer
- Observe both consumers holding the same message
- Kill the first consumer before it deletes
- Receive again and read
ApproximateReceiveCount
What you should observe
- Two consumers processing the same message simultaneously — the race from Module 08
ApproximateReceiveCountincrements 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