How to visually explore RabbitMQ queue bindings

May 12, 20252 min read

How to visually explore RabbitMQ queue bindings

How messages end up in queues in RabbitMQ?

If you think that a message can end up in a queue only if a publisher publishes it an exchange that has a binding to that queue, you are wrong. There are many ways messages can be routed to queues in RabbitMQ, and it can be hard to understand how they are connected in a single place if you only use the management plugin.

Other possibilities you should not overlook are:

  • Dead-letter exchanges: if a message is rejected or expires, it can be routed to a dead-letter exchange, which can then route it to a queue.
  • Alternate exchanges: if a message cannot be routed to any queue, it can be routed to an alternate exchange, which can then route it to a queue.

That mean that you have to look into three different places to understand how messages end up in queues, unless you are using a tool like RabbitGUI, which lets you visually explore RabbitMQ queue bindings in a single place.

Visually explore RabbitMQ bindings

Open up RabbitGUI and go to any queue or exchange in the "Routing" tab. Here we opened an exchange and see 3 bindings attached to it. All bindings have the badge "This" as the source, meaning that the exchange is the source of the bindings. The destination can be either a queue or an exchange, and it is shown in the "Destination" column. You can explore the bindings by clicking on the destinations.

An exchange with only bindings for rabbitmq

What are alternate exchanges and how to visualize them?

When a message arrives in an exchange and cannot be routed to any queue, it can be routed to an alternate exchange if one is defined. This is useful for handling messages that cannot be processed by any queue. In RabbitGUI, you can see the alternate exchange in the same view where you have your bindings:

An exchange with alternate exchange in rabbitmq

Here, messages with a routing key that match job.* will be routed to my-queue, while messages that do not match any binding will be routed to the alternate exchange events.dead-letter.

What dead-letter exchanges are and how to visualize them?

Dead-letter exchanges are used to handle messages that cannot be processed by a queue. When a message is rejected by the consumer, expires due to some TTL, or cannot be added to the queue because it is full, it can be routed to a dead-letter exchange. In RabbitGUI, dead-letter exchanges are just part of the routing view, so you can see them in the same place as the bindings:

A queue with bindings and a dead letter exchange in rabbitmq

Conclusion

Bindings, dead-letter exchanges, and alternate exchanges are all part of the routing mechanism in RabbitMQ. They can be hard to understand and visualize because they are often thought as very different tools. RabbitGUI provides a way to explore these connections visually in a single place, making it easier to understand how messages end up in queues.

More articles about RabbitMQ

Debugging policies in RabbitMQDebugging policies in RabbitMQWhile rules regarding which policies are applied to which queues are simple, visually understanding what is going on when something does not behave as expected might be trickyHow to introspect dead-letter queues with RabbitMQHow to introspect dead-letter queues with RabbitMQBy design, RabbitMQ has no API to peek at arbitrary messages, search for a specific one, or pick one at random. RabbitGUI is a tool that lets you introspect your dead-letter queues easilyProperly setting up dead-letter queues in RabbitMQProperly setting up dead-letter queues in RabbitMQLearn how to set up dead-letter queues in RabbitMQ, including creating a dead-letter exchange, binding it to a queue, and managing rejected messages via policies

RabbitGUI, the missing RabbitMQ IDE

Debug, monitor, and manage RabbitMQ with a modern developer interface.

Try nowRabbitGUI screenshot