0
0
RabbitMQdevops~15 mins

Virtual hosts for isolation in RabbitMQ - Mini Project: Build & Apply

Choose your learning style9 modes available
Virtual Hosts for Isolation in RabbitMQ
📖 Scenario: You are managing a RabbitMQ server that will be used by two different teams. To keep their messages and configurations separate, you want to create isolated environments using virtual hosts.
🎯 Goal: Learn how to create a virtual host in RabbitMQ, configure a user to access it, and verify the isolation by listing virtual hosts.
📋 What You'll Learn
Create a virtual host named team_alpha
Create a user named alpha_user with password alpha_pass
Set permissions for alpha_user on the team_alpha virtual host
List all virtual hosts to confirm creation
💡 Why This Matters
🌍 Real World
Virtual hosts in RabbitMQ help separate different projects or teams so their messages and configurations do not mix.
💼 Career
Understanding virtual hosts is important for managing RabbitMQ in production, ensuring security and organization in message handling.
Progress0 / 4 steps
1
Create the virtual host
Use the command rabbitmqctl add_vhost team_alpha to create a virtual host named team_alpha.
RabbitMQ
Need a hint?

Virtual hosts in RabbitMQ are like separate folders for messages. Use rabbitmqctl add_vhost followed by the name.

2
Create a user for the virtual host
Use the command rabbitmqctl add_user alpha_user alpha_pass to create a user named alpha_user with password alpha_pass.
RabbitMQ
Need a hint?

Users need a name and password. Use rabbitmqctl add_user with the username and password.

3
Set permissions for the user on the virtual host
Use the command rabbitmqctl set_permissions -p team_alpha alpha_user ".*" ".*" ".*" to give alpha_user full permissions on the team_alpha virtual host.
RabbitMQ
Need a hint?

Permissions control what a user can do. Use rabbitmqctl set_permissions -p with the virtual host, username, and regex patterns for configure, write, and read.

4
List all virtual hosts to verify
Use the command rabbitmqctl list_vhosts to display all virtual hosts and confirm that team_alpha exists.
RabbitMQ
Need a hint?

Listing virtual hosts shows all isolated environments. Use rabbitmqctl list_vhosts.