title: NodeJS AMQP Client can't connect
body: <p>I am going crazy for last two days, i cannot make connection on NodeJS client with durable exchange and durable queue.</p>
  
  <p>So PHP code creates and send message:</p>
  
  <pre><code>&lt;?php 
  $connection = new AMQPConnection(array(
  'host' =&gt; 'localhost',
  'vhost' =&gt; 'bvh',
  'port' =&gt; 5672,
  'login' =&gt; 'bizneus',
  'password' =&gt; 'lozinkus'
  ));
      //$connection = new AMQPConnection();
      $connection-&gt;connect();
      if (!$connection-&gt;isConnected()) {
          die('Not connected :(' . PHP_EOL);
      }
      // Open Channel
      $channel    = new AMQPChannel($connection);
      // Declare exchange
      $exchange   = new AMQPExchange($channel);
      $exchange-&gt;setName('biznea_e_1');       
      $exchange-&gt;setType('fanout');
      $exchange-&gt;setFlags(AMQP_DURABLE);
  
      $exchange-&gt;declare();
      // Create Queue
      $queue      = new AMQPQueue($channel);
      $queue-&gt;setName('notify');
      $queue-&gt;setFlags(AMQP_DURABLE);
      $queue-&gt;declare();
  
      $message    = $exchange-&gt;publish(json_encode($s), 'kljuc');
      if (!$message) {
          echo 'Message not sent', PHP_EOL;
      } else {
          echo 'Message sent!', PHP_EOL;
      }
  
      if ($connection-&gt;isConnected()) {
         $connection-&gt;disconnect();
      }
  </code></pre>
  
  <p>On screen it says that messege is sent.</p>
  
  <p>Next thing is NodeJS client, which should get messages, but it can't:</p>
  
  <pre><code>var amqp = require('amqp');
  
  var conParam = { 
    host: 'localhost', 
    port: 5672,  
    login: 'bizneus',   
    password: 'lozinkus',    
    vhost: 'bvh'  
  }
  var connection = amqp.createConnection(conParam);
  connection.on('ready', function(){
  
       var exchange = connection.exchange('biznea_e_1');
        var queue = connection.queue('notify');
        queue.bind('biznea_e_1', 'kljuc');
  
                  queue.subscribe( {ack:true}, function(message){
  
                      var dj = JSON.parse(message.data.toString());
  
                      console.log(JSON.stringify(dj));
  
                      queue.shift();
              });
  });
  </code></pre>
  
  <p>but I get this error</p>
  
  <pre><code>events.js:66
          throw arguments[1]; // Unhandled 'error' event
                         ^
  Error: PRECONDITION_FAILED - cannot redeclare exchange 'biznea_e_1' in vhost 'bvh' with different type, durable, internal or autodelete value
      at Exchange._onMethod (/home/zijad/node_modules/amqp/amqp.js:1824:15)
      at Exchange.Channel._onChannelMethod (/home/zijad/node_modules/amqp/amqp.js:1365:14)
      at Connection._onMethod (/home/zijad/node_modules/amqp/amqp.js:922:28)
      at AMQPParser.self.addListener.parser.onMethod (/home/zijad/node_modules/amqp/amqp.js:797:12)
      at AMQPParser._parseMethodFrame (/home/zijad/node_modules/amqp/amqp.js:442:10)
      at frameEnd (/home/zijad/node_modules/amqp/amqp.js:187:16)
      at frame (/home/zijad/node_modules/amqp/amqp.js:172:14)
      at AMQPParser.header [as parse] (/home/zijad/node_modules/amqp/amqp.js:159:14)
      at AMQPParser.execute (/home/zijad/node_modules/amqp/amqp.js:231:21)
      at Connection.&lt;anonymous&gt; (/home/zijad/node_modules/amqp/amqp.js:837:12)
  </code></pre>
  
  <p>I tried to remove var exchange = connection.exchange('biznea_e_1'); that line but than it cannot declare queue.</p>
  
  <p>I just want to send messages from PHP to NodeJS deamon and that is all!</p>
  
  <p>Help :)</p>