RabbitMQ - Listing ports using the rabbitmqctl command

by
Jeremy Canfield |
Updated: November 02 2021
| RabbitMQ articles
The rabbitmqctl status command can be used to display the ports RabbitMQ is configured to listen on.
rabbitmqctl status
Something like this should be returned.
{listeners,[{clustering,25672,"::"},{amqp,5672,"::"},{http,15672,"::"}]}
Or like this.
Listeners
Interface: [::], port: 15672, protocol: http, purpose: HTTP API
Interface: [::], port: 15692, protocol: http/prometheus, purpose: Prometheus exporter API over HTTP
Interface: [::], port: 25672, protocol: clustering, purpose: inter-node and CLI tool communication
Interface: [::], port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0
Likewise, the rabbitmqctl environment command can be used as well.
~]# rabbitmqctl environment | grep listen
{inet_dist_listen_max,25672},
{inet_dist_listen_min,25672}]},
{ssl_listeners,[]},
{tcp_listen_options,
{tcp_listeners,[5672]},
{listener,[{port,15672}]},
The --formatter json option can be used to return the output in JSON.
rabbitmqctl environment --formatter json
Did you find this article helpful?
If so, consider buying me a coffee over at