Query details about RabbitMQ producers and consumers

4.5k views Asked by At

Is there a way to get details about the current producers and consumers for a RabbitMQ instance?
As in is it possible to get details such as the IP address of a remote consumer.

I did go through the docs, but didn't find anything in this context.

2

There are 2 answers

0
theMayer On BEST ANSWER

This information is available via the Management Plug-In as well as the HTTP API.

You cannot query this information via AMQP, as it is out-of-band for the protocol. You can see publish rate on a given channel via the channels API, if I remember correctly.

Via the API:

/api/connections
A list of all open connections.
/api/vhosts/vhost/connections
A list of all open connections in a specific vhost.
/api/connections/name
An individual connection. DELETEing it will close the connection. Optionally set the "X-Reason" header when DELETEing to provide a reason.
/api/connections/name/channels
List of all channels for a given connection.
/api/channels
A list of all open channels.
/api/vhosts/vhost/channels
A list of all open channels in a specific vhost.
/api/channels/channel
Details about an individual channel.
/api/consumers
A list of all consumers.
/api/consumers/vhost
A list of all consumers in a given virtual host.

0
Rizwan_Mohammed On

If we are starting from scratch , it would be nice to have logs in the producers and consumers. Kind of distributed logs. Integrate the logs through some famous framework like splunk, datadog etc. Then through logs we can figure out who are the consumers and producers for a particular queue. It would be good design practise I suppose.