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 15 — Production-style worker service
Goal
Bounded pool, visibility heartbeat, graceful shutdown, metrics — the whole thing.
Setup
To be written — CLI commands and an IaC equivalent for every resource, all prefixed sqs-course-.
Steps
- Build the consumer from Lab 09 into a bounded worker pool
- Add a heartbeat that extends visibility for long-running messages
- Add a SIGTERM handler that stops polling, drains and batch-deletes
- Deploy to ECS Fargate with
stopTimeoutlonger than p99 processing - Deploy a new revision without the SIGTERM handler; count the redeliveries
- Redeploy with it; count again
- Add a liveness probe that fails when the poll loop stalls
What you should observe
- A deploy without graceful shutdown produces one redelivery per in-flight message
- The grace period must exceed processing time to be worth anything
- A naive health check cannot see a wedged poll loop
Why it happened
To be written — ties each observation back to the mechanism in 22 — Self-Managed Consumers on ECS, EKS and EC2.
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