У меня есть две очереди, два ключа привязки / маршрутизации, я хотел бы написать условное утверждение в приемнике на основе ключа маршрутизации / привязки, как получить их значения?
var amqp = require('amqplib/callback_api');
//const mongoose = require('mongoose');
var args = ['user','nouser'];
amqp.connect('amqp://localhost', function(err, conn) {
conn.createChannel(function(err, ch) {
var ex = 'logs';
ch.assertExchange(ex, 'direct', {durable: false});
ch.assertQueue('', {exclusive: true}, function(err, q) {
console.log(" [*] Waiting for messages in %s. To exit press CTRL+C");
args.forEach(function(type) {
ch.bindQueue(q.queue, ex, type);
});
ch.consume(q.queue, function(msg, res) {
if(msg.content) {
console.log(" Received %s", msg.content,q.queue);
}
}, {noAck: true});
});
});
});