Creating a RabbitMQ Virtual Host
Each virtual host serves as an independent RabbitMQ server. Virtual hosts provide logical separation of exchanges, queues, and bindings. Different applications run on different virtual hosts without interfering with each other. An instance can have multiple virtual hosts, and a virtual host can have multiple exchanges and queues. To connect a producer or consumer to a RabbitMQ instance, you must specify a virtual host. For details, see Virtual Hosts on the official RabbitMQ website.
Constraints
| Version | Constraints |
|---|---|
| 3.x.x |
|
| AMQP-0-9-1 |
|
Creating a RabbitMQ Virtual Host
A virtual host can be created on the console or management UI.
- Log in to the RabbitMQ console.
- Click
in the upper left corner to select the region where your instance is located. - Click
in the upper left corner and choose Application > Distributed Message Service for RabbitMQ to open the RabbitMQ instance list. - Click an instance name to go to the instance overview page.
- In the navigation pane, choose Instance > Virtual Hosts.
- Click Create Virtual Host.
- Enter a virtual host name and click OK.
Table 2 Virtual host naming rules Version
Naming Rule
3.x.x
- Use 2 to 128 characters, including letters, digits, and special characters .%|-_/. The name cannot be two periods (..).
- The virtual host name may affect the display of monitoring data. For details, see Constraints.
AMQP-0-9-1
- Use 2 to 32 characters, including letters, digits, and special characters .%|-_/. (Each special character is counted as three characters.) The name cannot be two periods (..).
- The virtual host name may affect the display of monitoring data. For details, see Constraints.
- The created virtual host is displayed in the virtual host list.
Table 3 Virtual host parameters Parameter
Description
Name
Virtual host name, which cannot be changed after being created. Click a virtual host name to go to its details page and view the exchanges and queues in the virtual host. For details, see Viewing a RabbitMQ Virtual Host.
Tracing
Whether message tracing is enabled. This parameter is available only in RabbitMQ 3.x.x. If it is enabled, you can trace the message forwarding path.
Operation
Click Delete in the Operation column to delete the virtual host. For details about how to delete a virtual host, see Deleting RabbitMQ Virtual Hosts.
Figure 2 Virtual host list (RabbitMQ 3.x.x)
Figure 3 Virtual host list (RabbitMQ AMQP-0-9-1)
- Log in to the RabbitMQ management UI.
- On the top navigation bar, choose Admin.
- In the navigation tree on the right, choose Virtual Hosts. Figure 4 Virtual hosts
- In the Add a new virtual host area, enter the virtual host name and click Add virtual host. Figure 5 Creating a virtual host (management UI)
After the creation is successful, the new virtual host is displayed in the All virtual hosts area.
Figure 6 Virtual host list (management UI)
Helpful Links
- To create a virtual host by calling an API, see Creating a Virtual Host.
- For details about how to export a RabbitMQ virtual host, see Exporting RabbitMQ Virtual Hosts.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot