I'm using amqplib with node.js and I'm trying to make sure I understand the concept of channels
.
This is from the amqplib documentation: Channels are multiplexed over connections, and represent something like a session, in that most operations (and thereby most errors) are scoped to channels.
Here is some basic code where I'll open a amqp connection, create a channel, an exchange and a queue:
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) {
});
});
In the above code do exchange '1'
and queue 'a'
only exist on the channel for which they were defined? By this I mean, if I were to publish a messages to exchange a
from another channel would exchange a
still route the messege?