--:--
rabbitmq/
RABBITMQ

RabbitMQ, live

One broker with a topic exchange, four queues and a few consumers, all running right here. Take a guided story, or play: add a publisher, crash a consumer, bind a queue with your own pattern, drag the timeline back, or type rabbitmqctl list_queues in the terminal.

Simulated time 0:00
Pick a story

Each story sets up a small broker and walks through it one event at a time. Guess what happens, then watch.

The basics

  • One message, start to finish

    Publisher, exchange, queue, consumer, ack: the whole path, slowly.

  • Work queues: sharing the load

    Two workers on one queue. Round-robin, a slow worker, and why prefetch 1 is fairer.

  • A worker dies holding messages

    Unacked messages come back, marked redelivered. With auto-ack they are lost.

Routing

  • Fanout: one message, every queue

    Publish/subscribe: a fanout exchange copies each message to all bound queues.

  • Direct: route by exact key

    Errors to one queue, everything to another; a key nobody bound is lost.

  • Topic: route by pattern

    Keys like quick.orange.rabbit and patterns like *.orange.* or lazy.#

  • Messages that match nothing

    Silently dropped, returned with mandatory, or caught by an alternate exchange.

When things go wrong

  • Dead letters and poison messages

    Rejected messages go to a dead-letter exchange; endless requeues are stopped by a delivery limit.

  • TTL: messages that expire

    A queue with a message TTL and a DLX makes a delay: the retry-later pattern.

  • A full queue

    x-max-length with drop-head pushes out the oldest; reject-publish refuses the newest.

What you see
  • A message, in its routing key’s colour
  • A delivery to a consumer
  • An ack going back
  • A nack, reject, drop or dead letter
  • A binding, labelled with its key
  • A consumer subscribed to a queue
  • Where dead letters go
  • A ready message in a queue (head on the right)
  • An unacked message
  • Redelivered

Publishers

shop1.2/s

to orders

  • order.created
  • order.paid
  • order.cancelled

confirms

sent 0 · confirmed 0 · returned 0 · nacked 0

Exchanges

orders

in 0 · routed 0 · unroutable 0

3 bindings

dlx

in 0 · routed 0 · unroutable 0

1 bindings

Queues

  1. empty

in 0 · acked 0 · redelivered 0 · dead-lettered 0 · dropped 0

DLX → dlx

  1. empty

in 0 · acked 0 · redelivered 0 · dead-lettered 0 · dropped 0

  1. empty

in 0 · acked 0 · redelivered 0 · dead-lettered 0 · dropped 0

max 10, drops oldest

  1. empty

in 0 · acked 0 · redelivered 0 · dead-lettered 0 · dropped 0

Consumers

billing-1idle

on billing

prefetch 2900 ms per message

acked 0 · nacked 0 · rejected 0 · lost 0

billing-2idle

on billing

prefetch 21300 ms per messageevery 6th fails → reject

acked 0 · nacked 0 · rejected 0 · lost 0

shipping-1idle

on shipping

prefetch 11500 ms per message

acked 0 · nacked 0 · rejected 0 · lost 0

audit-1idle

on audit

prefetch 5250 ms per message

acked 0 · nacked 0 · rejected 0 · lost 0

Queue dead

Arguments

No arguments: a plain classic queue.

Bound from

  • dlx ""

Consumers

Nobody is consuming from it.

Ready messages, head first

No ready messages.

NOTES

RabbitMQ notes

The concepts behind what you see above. They also live under Notes, tagged #rabbitmq.