tencent cloud

Feedback

Exchange Management

Last updated: 2024-09-10 14:51:00

    Overview

    A producer sends a message to an Exchange, which subsequently routes the message to one or more queues based on its attributes or content (or discards it). Then, a consumer pulls it from the Queue to consume it.
    This document describes how to create, delete, and query an Exchange in the TDMQ for RabbitMQ console.

    Prerequisites

    You have created a corresponding vhost as instructed in Vhost Management.

    Directions

    Creating an Exchange

    1. Log in to the RabbitMQ console
    2. In the left sidebar, choose Cluster Management >****Exchange tab, select a Vhost, and click Create to enter the Creating Exchange page.
    3. In the Create Exchange dialog box, enter the following information:
    
    Exchange Name: Enter the exchange name, which cannot be modified after creation and can contain 1–64 letters, digits, hyphens, and underscores.
    Routing Type: Select a routing type (direct, fanout, topic, or header), which cannot be changed after creation. For more information, see Exchange.
    Direct: A direct Exchange will route messages to the Queue with the BindingKey exactly matching the RoutingKey.
    Fanout: A fanout Exchange will route messages to all queues bound to it.
    Topic: A topic Exchange supports multi-condition match and fuzzy match, which means that messages will be routed to the Queue bound to it by using routing key pattern match and string comparison.
    Header: A header Exchange has nothing to do with Routing Key and matches messages by the Headers attribute. Before the Queue is bound to a Headers Exchange, declare a map key-value pair to implement the binding between the message queue and Exchange. When a message is sent to RabbitMQ, the Headers attribute of the message will be obtained to match the key-value pair specified during the Exchange binding, and the message will be routed to the queue only if there is a full match.
    Durable: If this option is set to true, the Exchange will still exist after the service is restarted; if it is set to false, the exchange will disappear after the service is restarted and needs to be created again.
    AutoDelete: If this option is set to true, when the last queue bound to the Exchange is deleted, the Exchange will be deleted automatically.
    Internal: If this option is set to true, the Exchange cannot be directly used by Producers but can only be bound to other Exchanges.
    Exchange Description: Enter the exchange description of up to 128 characters.
    Add Alternate Exchange: It is optional, and no alternate Exchange is used by default. Messages that are sent to the primary Exchange but cannot be routed will be sent to the alternate Exchange specified here.
    Note:
    The console will soon support the X-Delayed-Message routing type. If you need to use it, first create it in the open-source console - Exchanges ( For detailed directions on how to log in and access the RabbitMQ open-source console, see Accessing Native Console). When creating it, you need to specify the x-delayed-type for Arguments, as shown in the example below:++
    
    Note that the X-Delayed-Message type is not a built-in type of RabbitMQ. It requires the rabbitmq_delayed_message_exchange plugin to be enabled. For details, see Plugin Management.
    4. Click Submit, and you can see the created exchange in the exchange list.

    Editing an exchange

    1. In the exchange list, click Edit in the Operation column of the target exchange.
    2. In the pop-up window, you can edit the exchange description.
    3. Click Submit.

    Deleting an exchange

    1. In the exchange list, click Delete in the Operation column of the target exchange.
    2. In the pop-up window, click Delete.
    Note:
    After an exchange is deleted, all the configurations under it will be cleared and cannot be recovered.
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support