Overview
Virtual host (vhost) is a resource management concept in TDMQ for RabbitMQ. It is used for logical isolation. Exchanges and queues of different vhosts are isolated from each other.
Generally, different business scenarios can be isolated by vhost and configured with dedicated settings, such as message retention period.
This document describes how to create multiple vhosts in TDMQ for RabbitMQ so as to use the same TDMQ for RabbitMQ cluster in different scenarios.
Note:
Exchange and queue names must be unique in the same vhost.
Prerequisites
Directions
Creating vhost
2. In the left sidebar, choose Cluster Management > Vhost, click Create to enter the Create Vhost page.
3. In the Create Vhost window, configure the vhost attributes:
Vhost Name: Enter the vhost name, which cannot be modified after creation and can contain 1–64 letters, digits, "-", and "_".
Trace Plugin: The rabbitmq_tracing plugin can track messages in RabbitMQ. After it is enabled, you can use the message query feature in the console. Image queue: It is recommended to enable the image queue to ensure availability. This image queue can replicate the messages across multiple nodes in the RabbitMQ cluster, ensuring that messages in the queue are not lost in case of a node failure. (It cannot be enabled in a single-node cluster.) For specific parameters, see Default Mirroring Policy. Remarks: Enter the vhost remarks.
4. Click Submit.
Next steps: You can create an exchange and queue in the vhost to produce and consume messages.
Viewing a vhost
On the vhost list page, click the ID of the target vhost to enter the Basic Info page, which is divided into two modules:
Overview
Queue Count: The number of queues under the current vhost.
Exchange Count: The number of exchanges under the current vhost.
Channel Count: The number of channels under the current vhost.
User Count: The number of users under the current vhost.
Number of heaped messages: The number of the heaped messages under the current Vhost.
Production rate: The production rate of the current Vhost.
Consumption rate: The consumption rate of the current Vhost.
Connection List
The information of connections under the current vhost and the number of channels of each connection.
Modifying a vhost
The trace plugin can be toggled on/off on the vhost list page.
The Trace plugin can be enabled and disabled on the Vhost list page. It is recommended to use the Trace plugin for small-traffic verification or troubleshooting scenarios, and it is not advised to enable it when the cluster's TPS exceeds 10,000. Please readMessage Query. 1. On the Vhost list page, click Edit in the Operation column of the target vhost to enter the editing page.
2. Modify the description and click Submit.
Deleting a vhost
You can modify the description of a vhost in the following steps:
1. On the Vhost list page, click Delete in the Operation column.
2. In the deletion confirmation pop-up window, click Delete.
Note:
After a vhost is deleted, all the configurations under it will be cleared and cannot be recovered.
Was this page helpful?