2

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

Damian
  • 593
  • 6
  • 27
  • Can you show some code that creates exchanges an queues. In short: yes it is possible. But as it written, your question is not clear and it is hard to provide more assistance to you. Properties you are asking for (durability) are indeed configured on an application side (as almost everything in RabbitMQ). So, it is not clear what do you mean "I do not think I can configure on the application side". – pinepain Oct 07 '15 at 11:24
  • The code generally follows this sample https://github.com/rstoyanchev/spring-websocket-portfolio. The only difference is that it uses full featured message broker instead of that embedded in the Spring. – Damian Oct 07 '15 at 11:39
  • I know it is possible to set queue as non durable in the AMQP protocol but I intentionally mentioned it is Spring Websocket application which is using Stomp protocol. – Damian Oct 07 '15 at 11:41
  • 1
    Sorry, you are right, that is not trivial from the first look. Is it an option for you to `rabbitmqctl set_policy stomp-queues-expiry "^stomp-" '{"expires":10000}' --apply-to queues` as a workaround? – pinepain Oct 07 '15 at 14:01
  • 1
    I have already did it. It was the only solution I could find. But it solves the problem only partially... – Damian Oct 07 '15 at 14:14
  • Can you provide example destinations you are trying to SUBSCRIBE and SEND to? – pinepain Oct 07 '15 at 15:33

1 Answers1

2

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.

pinepain
  • 12,453
  • 3
  • 60
  • 65