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 09 — Build a Java consumer
Goal
A correct SDK v2 poll loop: long polling, batching, error isolation, batched deletes.
Setup
To be written — CLI commands and an IaC equivalent for every resource, all prefixed sqs-course-.
Steps
- Build an
SqsClientwith the default credential provider - Write the poll loop: long poll 10 messages
- Process each with per-message exception isolation
- Accumulate successful receipt handles and batch-delete
- Handle the
Failedlist from the delete - Add
ApproximateReceiveCountto every log line - Run it against a queue with a deliberately failing message
What you should observe
- The failing message retries while the others complete
- A consumer that isolates per-message errors does not lose a batch to one bad item
- Receive count in the logs tells you which messages are struggling
Why it happened
To be written — ties each observation back to the mechanism in 04 — Sending and Receiving Messages.
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