Debugging policies in RabbitMQ

April 30, 2025•2 min read•Product

Debugging policies in RabbitMQ

The right tool for the job

While the rules that RabbitMQ applies to choose which policy to apply to a queue are known, it can be cumbersome to debug and try to understand exactly which policy is applied and why. You can use the management plugin to go back and forth between the policies and the queues, but it is not very convenient. In this article we are going to use RabbitGUI to debug policies in RabbitMQ much faster.

How to know if a policy is applied to a queue?

Open RabbitGUI and go to the queue you are interested in. In the "Settings" tab you should see a "Policy" section indicating if the queue has a policy applied to it or not. In this case, the queue has no policy applied to it:

A queue without a policy

How to see which policy is applied to a queue?

If a policy is applied to the queue, it will be shown under the "Matched policy" label in the "Policy" card. Here we can see that the policy "My policy" is applied and that it defines both "Max length" and "Message TTL".

Note that those values are also present in the "information" card with a "Policy" badge attached to it, meaning that those values come from the policy and not from the queue itself.

A queue with a policy

How to see if a value is overridden by a policy?

Sometimes both the queue itself and the policy may define the same value. In this case, RabbitMQ will apply the value defined by the policy. RabbitGUI makes it easy to see which value is overridden directly from the UI, here the "Max length" value is overridden by the policy, showing the queue's value 500 crossed over.

A queue with overridden values by policy

What happens when multiple policies match a queue?

Since policies use regexp to match the name of queues, it is possible that multiple policies match the same queue. In this case, RabbitMQ will apply the policy with the highest priority. RabbitGUI shows you all the policies that match a queue, and highlights the one that is applied for easy debugging.

Multiple policies matching the same queue in rabbitmq

Debug policies in seconds

See which policies apply to each queue, why they match, and which values are overridden.

Debug my policies

Available on Windows, Mac, and Linux.

More articles like that

How to introspect dead-letter queues in RabbitMQProductHow to introspect dead-letter queues in 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 easilyHow to browse RabbitMQ messages without consuming themProductHow to browse RabbitMQ messages without consuming themRabbitMQ has no read-only API to browse a queue. Learn what the management UI's "Get messages" actually does, the side effects of requeueing, and how to inspect messages safely with RabbitGUI.How to spy on real-time queue traffic in RabbitMQ?ProductHow to spy on real-time queue traffic in RabbitMQ?Inspecting live messages flowing through a RabbitMQ queue is tricky because consuming is destructive. Learn how RabbitGUI creates a shadow queue to capture traffic without affecting your application.How to predict when a RabbitMQ queue will be empty?ProductHow to predict when a RabbitMQ queue will be empty?A step-by-step explanation of how to estimate backlog drain time for a RabbitMQ queue, from naive division to linear regression with adaptive windowing.Announcing RabbitGUI 1.1: Now on Windows and LinuxProductAnnouncing RabbitGUI 1.1: Now on Windows and LinuxRabbitGUI v1.1 brings native support for Windows, Linux, and Intel-based Macs, along with a built-in auto updater. Here's why this release matters.How to log into your CloudAMQP RabbitMQ instanceProductHow to log into your CloudAMQP RabbitMQ instanceUse RabbitGUI to connect to your CloudAMQP instance and manage your dead letter queues with ease