Firehose Tracer

Sometimes, during development or debugging, it's useful to be able to see every message that is published, and every message that is delivered. RabbitMQ has a "firehose" feature, where the administrator can enable (on a per-node, per-vhost basis) an exchange to which publish- and delivery-notifications should be CCed.

These notifications are close to what's happening on the wire - for example you will see unacked messages.

When the feature is switched off, it has no effect on performance; when it is switched on, performance will drop somewhat due to additional messages being generated and routed.

Enabling the firehose

To enable the firehose:

  1. Decide which node, and which vhost, you want to enable it for. In the examples below, we assume the default vhost, "/", and the default node "rabbit@(hostname)". Use the -n argument to rabbitmqctl to specify another node, and the -p argument to specify another vhost.
  2. Within your chosen vhost create queues, bind them to the exchange amq.rabbitmq.trace, and begin consuming.
  3. Run rabbitmqctl trace_on.

Disabling the firehose

To disable the firehose:

  1. Run rabbitmqctl trace_off.
  2. Clean up the queues used by the firehose.

Firehose notification format

When the firehose is enabled, you will start receiving messages to the exchange amq.rabbitmq.trace, with

  • routing key either "publish.exchangename", for messages entering the broker, or "deliver.queuename", for messages leaving the broker;
  • headers containing metadata about the original message: all its headers, properties, and a few other things
  • body corresponding to the body of the original message

The fields in the notification message body table describe the original message that was published or delivered.