2017-11-06 8 views
0

を意味する接続、それは述べて:AMQPのassertQueueのAPIドキュメントの

が存在するようにキューをアサートします。この操作は、同一の引数が与えられたときは等価です。ただし、キューがすでに存在していても異なるプロパティ(引数フィールドに指定されている値は、ボルケーティングの目的でカウントされている場合とカウントされていない場合があります。

http://www.squaremobius.net/amqp.node/channel_api.html#channel_assertQueue

私はそれが(INGの)BORKチャンネルで何を意味するかを求めています。私はgoogleを試みたが関連する何かを見つけることができない。

答えて

0

RabbitMQチームはthis mailing listを監視し、ときどきStackOverflowで質問に回答します。

2度目の異なるプロパティでassertQueueを2回呼び出すように試みましたか?あなたは自分の質問に非常に迅速に答えてくれました。 、そして、

#!/usr/bin/env node 

var amqp = require('amqplib'); 

amqp.connect('amqp://localhost').then(function(conn) { 
    return conn.createChannel().then(function(ch) { 
    var q = 'hello'; 
    var ok0 = ch.assertQueue(q, {durable: false}); 
    return ok0.then(function(_qok) { 
     var ok1 = ch.assertQueue(q, {durable: true}); 
     return ok1.then(function(got) { 
      console.log(" [x] got '%s'", got); 
      return ch.close(); 
     }); 
    }); 
    }).finally(function() { conn.close(); }); 
}).catch(console.warn); 

のRabbitMQを開始し、テストコードを実行します。

私はこのテストプログラムを作成するために this codeを使用しました。次のような出力が表示されます。

$ node examples/tutorials/assert-borked.js 
events.js:183 
     throw er; // Unhandled 'error' event 
    ^

Error: Channel closed by server: 406 (PRECONDITION-FAILED) with message "PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'hello' in vhost '/': received 'true' but current is 'false'" 
    at Channel.C.accept 
関連する問題