1

I'm using Rabbit.js to connect to a queue on a remote server. The issue is that every time I try to connect I get:

Error: Channel closed by server: 406 (PRECONDITION-FAILED) with message 
  "PRECONDITION_FAILED - inequivalent arg 'durable' for exchange 'WorkOrderQuery.Response' in vhost '/': received 'false' but current is 'true'"
  at Channel.C.accept (/Users/collumj/work/alpha/node_modules/rabbit.js/node_modules/amqplib/lib/channel.js:398:24)
  at Connection.mainAccept [as accept] (/Users/collumj/work/alpha/node_modules/rabbit.js/node_modules/amqplib/lib/connection.js:63:33)

I can provide code if needed. I've tried passing an options object with durable: true at relevant points to no effect. Everything is firing off in the correct order but I am always getting the error about the durable value being set wrong.

The question is: how do I look at a queue's page on the RabbitMQ server and determine what sort of socket I should use to connect to it? I can try a few but trying things blindly isn't a great way to go so I'd rather know that I'm using the right type.

It's possible that these two things have nothing to do with each other. If so, I'd appreciate an explanation because I'm clearly missing it.

Here's an image of my RabbitMQ Queue page:

enter image description here

Edit: changing my SUBSCRIBE socket to a PULL socket fixed it. Still not sure how I would have known (or if) from looking at the queue's page.

jcollum
  • 43,623
  • 55
  • 191
  • 321

1 Answers1

0

I don't know what's behind the abstraction your library is using but the error message:

"PRECONDITION_FAILED - inequivalent arg 'durable' for exchange 'WorkOrderQuery.Response' in vhost '/': received 'false' but current is 'true'"

Means that at some point your program declared an exchange as durable, but then tried to re-declare it as non-durable.

In RabbitMQ, whenever you re-declare exchanges or queues, you have to use the same arguments that where used when the resource was created

old_sound
  • 2,243
  • 1
  • 13
  • 16
  • That's what I thought, but I'm not declaring an exchange. I'm just trying to connect to a queue, so it's really confusing. – jcollum Jul 05 '15 at 17:27
  • Without seeing some code is hard to assess what's going on. Again, a library might be "connecting to a queue" on its API, but behind the scenes it might be declaring an exchange. – old_sound Jul 13 '15 at 13:06