user962563
user962563

Reputation: 505

RabbitMQ - security/authentication

I'm working on an application, and I'm just wondering is it possible for RabbitMQ to allow all clients to push messages to a specific queue and only authenticated users to consume messages from that queue? I can't seem to find anything about this :/

Basicly my model is like this: Clients all connect to same queue and push their messages on it. Also each client should register it's own queue where he recieves messages (each client has unique queue).

So basicly clients would send messages to one queue, and ONLY my server application should be able to read from it, process data and send reply to the specific user queue (which should be read ONLY by that user and ONLY server shoud publish on it).

I guess this is possible right? Can someone steer me in the right direction where to find more info on those things/examples/tutorials

Upvotes: 0

Views: 2589

Answers (1)

whiter4bbit
whiter4bbit

Reputation: 151

So, it is not possible AFAIK out of box, but you have 2 options:

  1. You can write own plugin for rabbitmq if you familiar with erlang (that's don't need extra erlang knowledge - just basics)
  2. You can create 2 virtual hosts and exchange on each host (vhost A for read vhost B for write). In virtual host B create exchange, and bind it to particular queue using routing key. In virtual host A create federated exchange[1]. Brief: federated exchange allows map exchange to upstream exchange, it means, that mapped exchange will receive all messages from upstream exchange. So make exchange E1 in virtual host A and map it to exchange E2 in virtual host B. For each virtual host you can create different users.

[1]: http://www.rabbitmq.com/federation.html - it's manual about federation plugin, that contains ready-to-go examples.

Upvotes: 1

Related Questions