【发布时间】:2014-01-29 17:50:34
【问题描述】:
我正在编写一个程序来通过 heroku 上的 amqp 使用 rabbitmq。
我的程序部分有这个代码:
console.log( 'APP START' );
//Connect to db and start
global.controllers.db.opendb(dbsettings, function(error,db){
if (!error){
global.db = db;
console.log( 'DB: connection to database established.' );
var con = amqp.createConnection( { url: global.queue.producers.host } );
con.on( 'ready', function() {
console.log( 'mq: producers connection ready.' );
});
}
});
据我了解,在成功连接到队列服务后,我应该只会收到一条消息。
我的输出中有很多包含 mq: producer connection ready. 的行,比如this,有什么特别的原因吗?
【问题讨论】: