Hands-on Python lessons
Messaging patterns
with ZeroMQ.
Send requests, publish updates and route work between processes. Learn how queues, timeouts and retries affect delivery and completion.
Course contents
Part 1
Messages and conversations
Send requests, preserve frames and follow each socket pattern’s rules.
- 01Send a request to another processConnect, send and receive a reply.Lab
- 02Preserve message boundariesBytes, frames and messages are different units.Lab
- 03Respect the REQ state machineA request socket waits for its reply before sending again.Lab
- 04Send work down a pipelineSend work in one direction and check what reached the receiver.Lab
- 05What completed when send returned?Identify what the sender and receiver know at each step of a request.Reading
- 06Who owns the socket?Choose context, thread/process ownership, transport and shutdown boundaries.Reading
Part 2
Publications and state
Subscribe to updates and handle data you missed.
- 07Filter a publicationMatch the first bytes of a topic name.Lab
- 08Meet the late subscriberFind out what a subscriber receives when it joins late.Lab
- 09Detect a sequence gapFind missing sequence numbers in a live feed.Lab
- 10Replay a cached valueGive a new subscriber the current value.Lab
- 11How does a late reader catch up?Design a snapshot/live handoff with versions, gaps and deletes.Reading
Part 3
Capacity and lifecycle
Handle full queues, timeouts and shutdown.
- 12Receive without blockingDistinguish no message from a message with zero bytes.Lab
- 13Bound a socket queueWatch a sender reach a queue limit.Lab
- 14Choose connection and close policySee what a socket accepts while no receiver is connected.Lab
- 15Where is the unfinished work?Measure a stated boundary and budget bytes, queues, fan-out and recovery.Reading
- 16What does silence tell you?Decide what to do when a reply or a worker’s check-in is late.Reading
Part 4
Routing and worker patterns
Route replies and distribute work to available workers.
- 17Route an envelopeAddress a reply to the right connection.Lab
- 18Reject an unknown routeAsk the router to report an unknown destination.Lab
- 19Match out-of-order repliesUse request IDs to match replies.Lab
- 20Forward through a real proxyFollow a request through a forwarding process.Lab
- 21Dispatch with worker creditSend a job only when a worker has room.Lab
- 22When does a worker own a job?Separate transient routes, readiness, assignment identity and effect ownership.Reading
Part 5
Reliability and security
Retry safely and protect connections.
- 23Retry with stable identityCompare repeated requests with repeated charges.Lab
- 24What is the wire contract?Specify which message bytes each side sends, what they mean and how those rules can change.Reading
- 25Encrypt a connectionSeparate an encrypted exchange from permission to act.Lab
- 26Who may issue the request?Connect encrypted transport to identity, authorization, secrets and data lifecycle.Reading
Part 6
Operations and integration
Observe connections and combine messaging with durable logs.
Part 7
Design review and capstone
Review a design, then diagnose a missing receipt.
Continue with event streaming
Explore retained logs, event-time windows and stateful recovery in Event Streaming Lab →