JSteunou / webstomp-client

Stomp client over websocket for browsers
Apache License 2.0
299 stars 59 forks source link

Subscribing to non-durable Queues #13

Open KoushikDasika opened 8 years ago

KoushikDasika commented 8 years ago

Hi! I'm working with RabbitMQ though CloudAMQP. I'm having my frontend connect to the service via your library and SockJS. I have two main queues that I want to be durable. A user on the frontend generates a random token and sends a request on one of those queues with the token. The server listens to those and publishes to a queue which is named by the token. It seems that the subscribe block in the frontend is creating the queue and making it durable. What headers do I set on the subscribe call so that the queue is not durable and auto-deletes? Here's what I attempted:

const ws = new SockJS('https://url.cloudamqp.com/stomp');
const client = webstomp.over(ws);
client.connect(username, password, () => {
  client.subscribe(token, callback, {"durable": false, "auto_delete": true});
}, failurecallback, vhost);
JSteunou commented 8 years ago

Depends the type of queue but I'm using mostly '/topic/xxxx' queue which are topics obviously and it's non-durable and auto-delete. Refer to RabbitMQ documentation or http://jmesnil.net/stomp-websocket/doc/ I'm sorry I do not know more about your case.