Learning/AWS SQS/29 — Hands-on Labs/Lab 15 — Production-style worker service
Advanced 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 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

  1. Build the consumer from Lab 09 into a bounded worker pool
  2. Add a heartbeat that extends visibility for long-running messages
  3. Add a SIGTERM handler that stops polling, drains and batch-deletes
  4. Deploy to ECS Fargate with stopTimeout longer than p99 processing
  5. Deploy a new revision without the SIGTERM handler; count the redeliveries
  6. Redeploy with it; count again
  7. 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