Rabbit MQ: creating queue, exchange and bindings from a command line

Rabbit Mq

Today we are going to discuss how to create queue, exchange and bind them together using command line instead of using client.

Please follow the steps for creating queue, exchange and binding from a command line -:

For creating Rabbit MQ exchange use the following command line -:

rabbitmqadmin -u {user} -p {password} -V {vhost} declare exchange name={name} type={type}

For example – You can create test.exchange with direct type as follows -:

rabbitmqadmin -u guest -p guest -V / declare exchange name=test.exchange type=direct

For creating Rabbit MQ queue use the following command line -:

rabbitmqadmin -u {user} -p {password} -V {vhost} declare queue name={name}

For example – You can create test.queue as follows -:

rabbitmqadmin -u guest -p guest -V / declare queue name=test.queue

For creating Rabbit MQ binding between exchange and queue use the following command line -:

rabbitmqadmin -u {user} -p {password} -V {vhost} declare binding source={Exchange} destination={queue}

For example – You can create binding between test.exchange and test.queue as follows -:

rabbitmqadmin -u guest -p guest -V / declare binding source=test.exchange destination=test.queue

That’s it, Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.

Discover more from WHO WILL CARE eCommerce

Subscribe now to keep reading and get access to the full archive.

Continue reading