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.
Exchange and queue names must be unique in the same vhost.
You have created a cluster.
- Log in to the TDMQ console, select the region, and click the ID of the target cluster to enter the cluster's basic information page.
- Select the Vhost tab at the top and click Create to enter the Create Vhost page.
- In the Create Vhost window, configure the vhost attributes:
- Vhost Name: enter the vhost name, which cannot be modified after creation and can contain 3–64 letters, digits, hyphens, and underscores.
- Message TTL: set the retention time of unconsumed messages. Messages will be automatically deleted if not acknowledged after expiration. Value range: 60 seconds–15 days.
- Remarks: enter the vhost remarks.
- Click Submit.
Next steps: you can create an exchange and queue in the vhost to produce and consume messages.
Prerequisite: you have created a role.
- On the Vhost list page, click Configure Permissions in the Operation column of the target vhost.
- On the Configure Permissions page, click Create to add production and consumption permissions to the vhost you just created.
You can modify a vhost in the following steps:
- On the Vhost list page, click Edit in the Operation column of the target vhost to enter the editing page.
- Modify the message TTL or remarks and click Save.
You can delete a created vhost in the following steps:
- On the Vhost list page, click Delete in the Operation column.
- In the deletion confirmation pop-up window, click OK.
After a vhost is deleted, all the configurations under it will be cleared and cannot be recovered.