Search code examples
rabbitmqstompspring-websocketspring-messaging

Spring+RabbitMQ make queues non durable


I am using RabbitMQ as a Stomp broker for Spring Websocket application. The client uses SockJS library to connect to the websocket interface. Every queue created on the RabbitMQ by the Spring is durable while topics are non durable. Is there any way to make the queues non durable as well? I do not think I can configure on the application side. I played a bit with RabbitMQ configuration but could not set it up either.

Example destination on RabbitMQ used for SUBSCRIBE and SEND:

services-user-_385b304f-7a8f-4cf4-a0f1-d6ceed6b8c92


Solution

  • It will be possible to specify properties for endpoints as of RabbitMQ 3.6.0 according to comment in RabbitMQ issues - https://github.com/rabbitmq/rabbitmq-stomp/issues/24#issuecomment-137896165:

    as of 3.6.0, it will be possible to explicitly define properties for endpoints such as /topic/ and /queue using subscription headers: durable, auto-delete, and exclusive, respectively.

    As a workaround you can try to create queues by your own using AMQP protocol and then refer to that queues from STOMP protocol.