Skip to content

Queues & Messages

In the first module you published a message and consumed it. That flow works — but it makes a lot of quiet decisions for you: the queue disappears on restart, the message lives only in memory, one consumer might hog everything, and messages pile up forever if nobody reads them.

This module is about the knobs. Each one is a small property on a queue or a message that changes what happens under load, on failure, and on restart.

LessonWhat you’ll learn
Queue propertiesdurable, exclusive, auto-delete, and x-* arguments
Message propertiesPersistence, content type, headers, priority, and correlation
AcknowledgementsManual vs auto ack, requeue, and at-least-once delivery
Prefetch & QoSFair dispatch, and why unbounded prefetch overloads one worker
TTL & limitsMessage/queue expiry, max length, and overflow behaviour

Everything here lives on one of two things — the queue (declared once, shared by everyone) or the message (set fresh on every publish):

flowchart LR
  q["Queue properties
(durable, exclusive,
auto-delete, TTL, max-length)"] --> life["shape the queue's
lifecycle & limits"]
  m["Message properties
(persistent, priority,
headers, content-type)"] --> deliv["shape one message's
delivery & handling"]
Where the knobs live

Getting these right is most of what separates a demo from a system you’d trust in production. The single most important one — acknowledgements — is the mechanism behind “at-least-once” delivery, so give that lesson extra attention.

What do queue and message properties fundamentally control?
Where do "queue properties" versus "message properties" apply?
Which knob is the mechanism behind at-least-once delivery?