postwait / node-amqp

[UNMAINTAINED] node-amqp is an AMQP client for nodejs
MIT License
1.69k stars 357 forks source link

alternate-exchange exchange option #131

Open pdelanauze opened 11 years ago

pdelanauze commented 11 years ago

I need to connect to an exchange requiring 'alternate-exchange': 'unknown', which i try and set in the options along the type: 'topic' option, but it doesn't seem to pick it up.

I'm seeing:

Error: PRECONDITION_FAILED - inequivalent arg 'alternate-exchange'for exchange 'transform' in vhost '/': received none but current is the value 'unknown' of type 'longstr'

Here's how i setup my exchange:

amqp.exchange('transform', {
      type:'topic',
      durable:true,
      'alternate-exchange': 'unknown'
    }, function (exchange) {

Passing in the parameter in an arguments object like below does not work either ...

amqp.exchange('transform', {
      type:'topic',
      durable:true,
      'arguments': {
        'alternate-exchange': 'unknown'
      }
    }, function (exchange) {
barshow commented 11 years ago

the second way you specified is correct. Below should work if you ae is actually called unknown

amqp.exchange('transform', {
      type:'topic',
      durable:true,
      arguments: {
        'alternate-exchange': 'unknown'
      }
    }, function (exchange) {
pdelanauze commented 11 years ago

I'll give it another shot but the second way did not work for me yesterday

barshow commented 11 years ago

Im using it in production and its working, are you using the npm version pulling from master here on the github? We're using master here.