这是我的代码:
var amqp = require('amqp');
var connection = amqp.createConnection( { host: 'localhost' }, { defaultExchangeName: 'testexchange' });
connection.on('ready', function () {
console.log('Connected to rabbitmq');
var exchange = connection.exchange('testexchange', {confirm:true}, function(exch){
console.log('Created exchange: ' + exch.name);
var queue = connection.queue('testqueue', { durable: true }, function(q) {
exch.publish('testqueue', {a:1}, {}, function(error) {
console.log(error);
});
});
});
});
我正在使用节点 0.10.2 和节点 amqp 0.1.6,
我可以看到textexchange
,rabbitmqctl list_exchanges
但是没有testqueue
,rabbitmqctl list_queues
怎么了?