Updated on 2023-05-05 GMT+08:00

Deleting a Virtual Host

Method 1: Deleting a Virtual Host on the Console

  1. Log in to the management console.
  2. In the upper left corner, click and select a region.

    Select the region where your RabbitMQ instance is.

  3. Click and choose Middleware > Distributed Message Service for RabbitMQ to open the console of DMS for RabbitMQ.
  4. Click an instance to go to the details page.
  5. In the navigation pane, choose Virtual Hosts.
  6. Delete virtual hosts using either of the following methods:

    • Select one or more virtual hosts and click Delete Virtual Host in the upper left corner.
    • In the row containing the virtual host you want to delete, click Delete.

  7. In the confirmation dialog box that is displayed, click Yes.

Method 2: Deleting a Virtual Host on the RabbitMQ Management UI

  1. Log in to the RabbitMQ management UI.
  2. On the top navigation bar, choose Admin.
  3. In the navigation tree on the right, choose Virtual Hosts.

    Figure 1 Virtual Hosts page

  4. Click the name of the virtual host to be deleted.

    Figure 2 Virtual host to be deleted

  5. In the Delete this vhost area, click Delete this virtual host. A confirmation dialog box is displayed.

    Figure 3 Deleting a virtual host

  6. Click OK.

Method 3: Deleting a Virtual Host by Calling an API

  1. In Linux, connect to the RabbitMQ instance.
  2. Run the following command to delete a virtual host:

    curl -i -X DELETE http://${USERNAME}:${PASSWORD}@${HOST}:${PORT}/api/vhosts/${VHOST_NAME}

    Parameter description:

    • USERNAME: username set when the RabbitMQ instance was created. View the username in the Connection area on the instance details page.
    • PASSWORD: password set when the RabbitMQ instance was created. If you forget the password, reset it.
    • HOST: IP address of the management UI. View the management UI address in the Connection area on the instance details page.
    • PORT: port of the management UI. View the management UI port in the Connection area on the instance details page.
    • VHOST_NAME: name of the virtual host to be deleted.

    Example:

    curl -i -X DELETE http://root:txxxt@192.168.1.3:15672/api/vhosts/vhost-demo

    If the deletion is successful, the following information is displayed.

    Figure 4 Virtual host deleted successfully