Persistent queues when subscribing to an exchange
RookieIndieDev opened this issue · 2 comments
RabbitMQ's STOMP and Web STOMP plugins support durable subscriptions but only the ID header is being set. How to set headers like auto-delete
and durable
. Is there a way to create a durable subscription with stompjs when subscribing to exchanges? Even if I managed to create a durable queue my client subscribe to, would it subscribe to the same queue when it has to reconnect?
I guess you already know the requisite headers to set (if not, please check https://www.rabbitmq.com/stomp.html#d.dts). The library API allows setting headers during subscription - please refer to https://stomp-js.github.io/api-docs/latest/classes/Client.html#subscribe. You can set headers, including the id
.
Figured out a workaround, could not get it to work with StompJS, had to use PHP amqplib to create and bind durable queues for each consumer and bind them to the exchanges.