I have 100 clients. Each client has unique username, password and two channels (users can't connect to different channels apart from their own). Should I create VirtualHost for each user?
How to write proper user permission to the below situation?:
my_user
can connect only to vahost called user_vhost
using username
and password
my_user
can consume only from the user_channel
channelmy_user
can publish only to the user_channel
channelmy_user
can connect remotelyThank You!
Vhosts (Virtual Hosts) in RabbitMQ provides a way to segregate applications using the same RabbitMQ instance. RabbitMQ vhosts creates a logical group of connections, exchanges, queues, bindings, user permissions, etc. within an instance.
Different users can be granted access only to specific virtual hosts. Their permissions in each virtual hosts also can be limited. RabbitMQ supports two major authentication mechanisms as well as several authentication and authorisation backends. Password-based authentication has a companion guide.
A virtual host can be deleted using rabbitmqctl's delete_vhost command which accepts virtual host name as the only mandatory argument.
What Does Virtual Host (vhost) Mean? A virtual host is is a type of hosting service provider that focuses on virtual infrastructure solutions, including virtual servers, computers, storage and other hybrid platforms that enable the hosting of data, applications and/or services.
Virutal host in RabbitMQ is more like a logical container where a user connected to a particular virtual host cannot access any resource (exchange, queue...) from another virtual host. I always think about it like a administrative domain kind of thing.
Based on what you have explained, I think having a virtual host per user is a good way to keep things simple and clean. Also, this way you do not need to come up with complicated permissions rules, just grant permissions based on virtual host.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With