websocketrabbitmqstompstompjs

Rabbitmq set name for webstomp / stompjs temporary queues


I just wanted to ask if it is possible to specify the name for the temporary auto-delete queues, which are bound to the destination when I subscribe to a webstomp queue/exchange.

The reason is, that I would like to specify a fine graded JWT permission control, so I would like to give permission f.e. to "stomp-subscriptions-user123-abcde" and therefore I would like to call the temporary queue name not "stomp-subscription-randomstring", but "stomp-subscriptions-user123-randomstring".

Is this possible?

I looked through the available documentation, but couldn't find anything (only the name of the subscription id, but not of the temporary queue name).

Documentation: https://stomp-js.github.io/


Solution

  • Here is the source code for the function that generates a queue name:

    https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbitmq_stomp/src/rabbit_stomp_util.erl#L368-L382

    Notice that it only auto-generates a name if the x-queue-name header is NOT present. So, it looks like you can specify whatever name you'd like via that header. Here is the documentation for it:

    https://www.rabbitmq.com/stomp.html#d.ugqn