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