When you subscribe to an exclusive queue (only one consumer allowed at a time), node-amqp throws an exception when the queue is oversubscribed (already has a consumer).
- I've tried using the .on("error",cb) syntax.
- I've tried error domains (node 0.10.0)
- Try/catch obviously didn't work
Here's my subscription line, but it's nothing special:
queue.subscribe({ack: true, prefetchCount: 1, exclusive: exclusive}, cbExecute).addCallback((ok) -> listeners[type] = ok.consumerTag);
You get an unhandled exception thrown when queue is in use:
ACCESS_REFUSED - queue 'respQ' in vhost 'brkoacph' in exclusive use
Looking inside node-amqp I see that they implement an independent task queue inside the module so that when the error occurs, the task is running in an independent context.
Is there any work-around/fix? ...or am I just doing something wrong?