RabbitMQ Bindings (Bind Queue to Exchange)

In rabbitmq, binding is a connection which is used to configure a relation between a queue and an exchange. In simple words we can say, binding is a relationship between an exchange and a queue.


In previous chapters, we learned how to create an exchangesqueues in rabbimq. Now we will learn how to bind an exchange with queue using routing key and this will be used for direct type exchange. In rabbitmq, exchange will route the request to particular queue on the basis of routing key.

RabbitMQ Bind Queue to Exchange

To bind a queue to exchange, Go to Queues tab and then click on the queue (demoqueue) which is created like as shown below.


RabbitMQ Queues List to Bind to Exchange


After click on queue (demoqueue) name, the Bindings panel will expand and next it will ask for the exchange name, enter exchange name which we have created “demoexchange” and routing key “demokey” and click on Bind button.


RabbiMQ Enter Details to Bind Queue to Exchange


After click on Bind button, the defined exchange (demoexchange) will be bind to our queue (demoqueue) and that will be like as shown below.


RabbitMQ After Binding Queue to Exchange


After binding, in case if you want to unbind it then you can click on unbind button to remove binding.