This topic describes how to create a virtual host (vhost), view statistics of a vhost, view the connection information about a vhost, and delete a vhost in the Message Queue for RabbitMQ console.

Background information

A vhost is a virtual host that is used to logically isolate resources. Vhosts manage their own exchanges, queues, and bindings. Applications can run on independent vhosts in a secure manner. This way, the business of an application is not affected by other applications. An instance can have multiple vhosts, and a vhost can have multiple exchanges and queues. To connect a producer or consumer to Message Queue for RabbitMQ, specify a vhost for the producer or consumer.

Precautions

You can delete a vhost only after all the exchanges and queue resources in the vhost are deleted.

Create a vhost

  1. Log on to the Message Queue for RabbitMQ console. In the left-side navigation pane, select Instances.
  2. In the top navigation bar of the Instances page, select a region. In the instance list, click the name of the instance that you want to manage.
  3. In the left-side navigation pane, click vhosts.
  4. On the vhosts page, click Create vhost.
  5. In the Create vhost panel, enter a vhost name in the vhost Name field and click OK.
    Note
    The vhost name must comply with the following naming conventions:
    • The name can contain letters, digits, and the following special characters: -_.#/@
    • The name must be 1 to 255 characters in length. Additional characters are automatically truncated.
    • After a vhost is created, you cannot change the name of the vhost.
    On the vhosts page, the created vhost appears.

View statistics of a vhost

You can view various metric data to identify and locate problems at the earliest opportunity.

  1. In the top navigation bar of the Instances page, select a region. In the instance list, click the name of the instance that you want to manage.
  2. In the left-side navigation pane, click vhosts.
  3. You can view statistics of a vhost based on your business requirements.
    • View the statistics of the vhost: On the vhosts page, find the vhost and click the vhost name, or click Details in the Actions column. On the Dashboard tab of the vhost Details page, view the statistics of the vhost.
    • View the vhost and statistics of the vhost, such as exchange and queue data: On the vhosts page, find the vhost, and click Dashboard in the Actions column.

    The statistics of the vhost vary based on the instance edition. The following list describes the statistics of various instance editions.

    • Basic Edition and Professional Edition: CloudMonitor is used to provide metric monitoring data. For more information about metrics provided by CloudMonitor, see Monitoring and alerting.
      Note Message Queue for RabbitMQ instances of the Basic Edition and Professional Edition are deprecated. You can continue to use the purchased instances of the Basic Edition.
    • Enterprise Edition and Platinum Edition: You can view metrics provided by Application Real-Time Monitoring Service (ARMS) Prometheus Service and Grafana. For more information about the dashboard and metrics, see Dashboard.

View the information about the connection that is established to the vhost

After a vhost is created and the connection between the vhost and the client is established, you can view the connection details, including the IP address of the client, the connection status, the status of each channel for the connection, and the number of messages that are sent and received per minute.

  1. In the top navigation bar of the Instances page, select a region. In the instance list, click the name of the instance that you want to manage.
  2. In the left-side navigation pane, click vhosts.
  3. On the vhosts page, find the vhost about which you want to view the connection information, and choose More > Connection Details in the Actions column. On the Connection Details tab of the vhost Details page, view the information about the connection that is established to the vhost.

    You can also click the vhost name, click Details in the Actions column. On the Connection Details tab of the vhost Details page, view the information about the connection that is established to the vhost.

    pg_view_vhost_detail
    Table 1. Parameters required to view the information about a connection
    Parameter Description
    Connection The IP address of the client.
    Connection Name The connection name defined on the client.
    AccessKey ID The AccessKey ID of your account.
    State The status of the connection.
    SSL/TLS Specifies whether an SSL connection or Transport Layer Security (TLS) connection is enabled.
    Protocol The version of Advanced Message Queuing Protocol (AMQP).

Delete a vhost

Warning If you delete a vhost, all data in the vhost is deleted and cannot be restored. Proceed with caution.
  1. In the top navigation bar of the Instances page, select a region. In the instance list, click the name of the instance that you want to manage.
  2. In the left-side navigation pane, click vhosts.
  3. On the vhosts page, find the vhost that you want to delete, and choose More > Delete in the Actions column.
    You can also click the name of the vhost that you want to delete or Details in the Actions column of the vhost. Then, click Delete in the upper-right corner of the vhost Details page.
  4. Read the Note message that appears and click OK.