Search code examples
rabbitmqweb-stomp

Prevent RabbitMQ web-stomp client from sending


I have RabbitMQ + WebStomp. I would like totally restrict ability to send info to queue from JavaScript code. Instead only server side should do this.

In other words I would like allow following code:

...
client.subscribe("/queue/My-One-Way-Queue", function(m) {
...
client.onreceive = function(message) {
    console.log(message);
}

And prevent malicious software to do following:

client.send('/queue/My-One-Way-Queue', 
    {'reply-to': '/temp-queue/My-One-Way-Queue'}, text);

Solution

  • You need to create a user for the JavaScript client that has read permissions only. See: https://www.rabbitmq.com/access-control.html