Learning/AWS SQS/29 — Hands-on Labs
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.

Hands-on Labs

Reading about visibility timeout and watching a message reappear 30 seconds after you killed a consumer are different experiences. These labs are the second one.

Every lab is self-contained, runs in a single AWS account, and ends with a teardown step.

Before you start

  • Complete Module 00 — credentials, CLI, Java 21, SDK v2
  • Set a billing alarm. Every lab below fits inside the free tier if you tear down, and none of them fit if you leave a tight-poll loop running for a week
  • Use a dedicated prefix (sqs-course-*) for every resource so teardown is easy
  • Work in one Region and stay in it

Lab format

Each lab file follows the same shape:

  1. Goal — the one thing this lab makes real
  2. Module — what to read first
  3. Estimated time and estimated cost
  4. Setup — resources to create (CLI and IaC)
  5. Steps — numbered, copy-pasteable
  6. What you should observe — the specific output or metric that proves the point
  7. Why it happened — tying the observation back to the mechanism
  8. Experiments — deliberate variations to try
  9. Teardown — every resource, in order

The labs

#LabWhat it makes realRead first
01Create your first queueQueue URL vs ARN, the attributes that matter on day one04
02Send and receive a messageThe three-call round trip; MessageId vs ReceiptHandle04
03Watch visibility timeoutA message going invisible, then coming back08
04Force a redeliveryKill a consumer mid-processing; watch ApproximateReceiveCount climb05, 08
05Configure a DLQA poison message landing in quarantine after exactly maxReceiveCount receives11
06FIFO ordering and message groupsOrdering inside a group; parallelism across groups; head-of-line blocking07
07Long polling vs short pollingCount the API calls both ways; see empty receives vanish12
08Batch APIsSame throughput, one tenth the API calls; handle a partial failure13
09Build a Java consumerA correct poll loop with SDK v204, 12
10Spring Boot producer and consumerSqsTemplate and @SqsListener end to end23
11SQS + LambdaThe whole-batch-retry bug, then ReportBatchItemFailures fixing it19
12SNS → SQS fanoutOne publish, two queues, a filter policy20
13S3 → SQSUpload triggers a message; the multipart-upload trap21
14Implement idempotencyDeliberately deliver twice; prove the effect happened once09
15Production-style worker serviceBounded pool, heartbeat, graceful shutdown, metrics14, 22
16Monitor with CloudWatchA dashboard and alarms that actually fire on the right thing17
17Break it and fix itAn injected failure, diagnosed from metrics alone26

Suggested tracks

Weekend fundamentals (labs 1–5) — enough to be useful on a real queue.

Interview prep (labs 1–8, 11, 14) — every mechanism that gets asked about.

Production readiness (labs 9, 10, 14, 15, 16, 17) — what you need before you own a queue on call.

Teardown

Each lab ends with its own teardown. A sweep script that removes every sqs-course-* resource in the Region lives in this directory — run it when you finish.

⚠️ The sweep script deletes queues and their messages permanently. Read it before running it.


Previous: 28 — Corporate Case Studies · Index: Course home · Next: 30 — Capstone Project