Binding a RabbitMQ Queue
Binding a queue is to relate an exchange to a queue. In this way, producers send messages to exchanges and exchanges route these messages to related queues.
This section describes how to bind queues for an exchange on the console. Exchanges with queues bound can route and store messages to the queues. An exchange can be bound with multiple queues.
Notes and Constraints
- In RabbitMQ 3.x.x, the exchange (AMQP default) cannot be bound with any queue.
- Internal exchanges can only be bound with exchanges and not queues.
Prerequisites
- An exchange has been created.
- A queue has been created.
Binding a Queue to an Exchange
- Log in to the console.
- In the upper left corner, click and select a region.
Select the region where your RabbitMQ instance is.
- Click and choose Application > Distributed Message Service for RabbitMQ to open the console of DMS for RabbitMQ.
- Click an instance name to go to the instance details page.
- In the navigation pane, choose Virtual Hosts.
- Click a virtual host name.
- On the Exchange tab page, click Bind Exchange in the row containing the desired exchange. The Bind Exchange page is displayed.
- Click Add Binding. The Add Binding dialog box is displayed.
- Set the parameters by referring to Table 1.
Table 1 Binding parameters Parameter
Description
Type
Select the binding type: To bind a queue, select Queue.
Target
Select a target queue to be bound.
Routing Key
Enter a key string to inform the exchange of which queues to deliver messages to.
- This parameter is required by direct exchanges and topic exchanges. Such exchanges route messages to queues with the routing keys matched. If this parameter is not set, exchanges route messages to all the bound queues.
- For fanout exchanges and header exchanges, skip this parameter.
- Click OK.
On the Bindings page, view the bound queue.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.