tencent cloud

Feedback

Exchange Management

Last updated: 2024-01-03 11:42:22

    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 one of these queues and consumes it.
    This document describes how to create, delete, and query an exchange in the TDMQ for RabbitMQ console.

    Prerequisites

    You have created a vhost as instructed in Vhost Management.

    Directions

    Creating an exchange

    1. Log in to the TDMQ console, select the region, and click the ID of the target cluster to enter the Basic Info page of the cluster.
    2. Click the Exchange tab at the top, select a vhost, and click Create to enter the Create Exchange page.
    3. In the Create Exchange window, 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.
    Route Type: Select a route type (direct, fanout, topic, or header), which cannot be changed after creation. For more information on route types, see Exchange.
    Direct: A direct exchange will route messages to the queue with the binding key exactly matching the routing key.
    Fanout: A fanout exchange will route messages to all queues bound to it.
    Topic: A topic exchange supports multi-condition match and fuzzy match; that is, it will route messages to the queues 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. When binding a queue to a header exchange, declare a map key-value pair to implement the binding. When a message is sent to RabbitMQ, the Headers attribute of the message will be obtained to match the key-value pair specified during 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: This parameter 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.
    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