Course lesson 21 · Working with Queues
Creating & Using Queues
The instructor creates a staging queue, configures the data-service Worker as its consumer, and implements a queue handler that logs message bodies. Sending test messages in the dashboard makes batching visible: one handler invocation can contain several messages. Pausing and resuming delivery then demonstrates that accepting messages and delivering them to a consumer are separate operations.
Primary source: course video 21 · Supplied English subtitles · 00:08:50.
Understand the idea
- The queue name in configuration connects the deployed Worker to the intended queue resource.
- A consumer configuration needs an actual queue handler exported through the Worker entrypoint.
- The handler receives a batch; each message has a body and delivery-related metadata and methods.
- Explicit acknowledgement marks a message as processed; retry requests another attempt.
- Pausing delivery lets messages accumulate, which is useful when investigating a consumer problem.
What the course does
- Create a queue with a staging name in the dashboard.
- Add a consumer entry to the data service’s Wrangler configuration using that queue name.
- Implement an asynchronous queue handler and iterate through the batch to log each body.
- Deploy the data service and open its real-time logs.
- Send “Hello World” messages and observe one invocation containing multiple messages.
- Pause delivery, send more messages, inspect the pending queue, then resume and observe it drain.
Watch for
- The recording states one consumer Worker per queue; a single Worker may consume multiple queues. These are different relationships.
- Course caveat: live logs may appear with a delay and sometimes behave inconsistently.
- Added advice: pausing is not indefinite archival storage; account for the queue’s configured retention.
Recall before revealing
What is the difference between a message and a batch in this lesson?
Reveal the explanation
A message contains one event body; a batch groups several messages delivered together to one queue-handler invocation.
Try it
Using a test queue, send several distinguishable messages while delivery is paused, then resume it and compare invocation logs with individual message logs.
Check your result
You can identify both the batch-level trigger and each message processed within it, and explain why the message count need not equal the invocation count.
Practice prompts and answer checks are added teaching material. Answer from memory first, then compare and explain any difference.
Rewatch only what you need
Open this lesson in your original course library and seek to the times below. Videos are not hosted on this site.
- 00:01:54 — Implementing the Worker queue handler
- 00:02:50 — Message metadata and acknowledgement
- 00:05:14 — One consumer Worker per queue
- 00:06:37 — Observing a batch containing several messages
- 00:07:04 — Pause and resume delivery
Companion primary documentation: Queues delivery guarantees. For recorded API names, commands, limits, and prices, check the version you use.