Updated on 2025-07-14 GMT+08:00

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

Binding a Queue to an Exchange

  1. Log in to the RabbitMQ console.
  2. Click in the upper left corner to select the region where your instance is located.
  3. Click an instance name to go to the instance details page.
  4. In the navigation pane, choose Instance > Virtual Hosts.
  5. Click a virtual host name.
  6. On the Exchange tab page, click Bind Exchange in the row containing the desired exchange. The Bind Exchange page is displayed.
  7. Click Add Binding. The Add Binding dialog box is displayed.
  8. Set the parameters by referring to Table 1.

    Table 1 Binding parameters

    Parameter

    Description

    Type

    Only RabbitMQ 3.x.x instances have this parameter. RabbitMQ AMQP-0-9-1 instances only support binding queues.

    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. Messages cannot be routed to target queues without a routing key.
    • Enabling x-consistent-hash exchanges requires a routing key which indicates the weight of a queue. The larger the key, the heavier the weight, which means that the queue receives more messages.
    • For fanout exchanges and header exchanges, skip this parameter.

  9. Click OK.

    On the Bindings page, view the bound queue.

Related Document

To bind a queue by calling an API, see Adding a Binding.