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 07 — Long polling vs short polling
Goal
Count the API calls both ways and watch empty receives disappear.
Setup
To be written — CLI commands and an IaC equivalent for every resource, all prefixed sqs-course-.
Steps
- Run a consumer with
WaitTimeSeconds = 0against an empty queue for 5 minutes - Record
NumberOfEmptyReceivesfrom CloudWatch - Run the same consumer with
WaitTimeSeconds = 20for 5 minutes - Compare the two metric values
- Send a message during the long-polling run and measure how quickly it is returned
- Set the SDK read timeout below 20 s and observe the client-side failure
What you should observe
- Empty receives drop by orders of magnitude
- Long polling returns immediately on arrival — latency goes down, not up
- A client timeout shorter than the wait breaks every call
Why it happened
To be written — ties each observation back to the mechanism in 12 — Long Polling.
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