0

私は node.js で amqplib を使用していchannelsます。

これは、amqplib のドキュメントからのものです。Channels are multiplexed over connections, and represent something like a session, in that most operations (and thereby most errors) are scoped to channels.

amqp 接続を開き、チャネル、交換、およびキューを作成する基本的なコードを次に示します。

var amqp = require('amqp/callback_api');
var connection = amqp.createConnection({ host: "localhost", port: 5672 });



connection.on('ready', function () {
    connection.createChannel(function(err, ch) {
        ch.assertExchange('1', 'fanout', function(err, ok) {});
        ch.assertQueue('a', {
            exclusive: true,
            durable: true
        }, function(err, ok) {

        });
    });

上記のコードでは、それらが定義されたチャネルにのみ存在しますかexchange '1'? つまり、別のチャネルqueue 'a'から交換するメッセージを公開する場合、交換は引き続きメッセージをルーティングしますか?aa

4

1 に答える 1