Bootstrap FreeKB - RabbitMQ - List Bindings using the rabbitmqctl list_bindings command
RabbitMQ - List Bindings using the rabbitmqctl list_bindings command

Updated:   |  RabbitMQ articles

The rabbitmqctl command with the list_bindings option can be used to list a virtual hosts bindings.

rabbitmqctl list_bindings

 

Which should produce something like this. By default, if the -p option is not used, the / virtual host will be used.

  • field 1 = source_name (typically exchange name)
  • field 2 = source_kind (typically "exchange")
  • field 3 = destination_name (typically queue name)
  • field 4 = destination_kind (typically "queue")
  • field 5 = routing_key
  • field 6 = argument
Listing bindings
exchange001    exchange    queue001    queue    key1 []
exchange002    exchange    queue002    queue    key1 []
exchange003    exchange    queue003    queue    key2 []

 

The -p or --vhost option can be used to specify a virtual host, like this.

rabbitmqctl list_bindings --vhost vhost001

 

You can specify the items you wish to include in the output, like this.

rabbitmqctl list_bindings source_name destination_name routing_key

 

Be aware that queues that begin with "amq.gen" were most likely created when a shovel was setup to move messages.

exchange001    exchange    amq.gen-iRdCIzvottKSQn4hI5VKgw  queue    key1 []

 

The --formatter json option can be used to return the output in JSON.

rabbitmqctl list_bindings --formatter json

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 353d37 in the box below so that we can be sure you are a human.