【发布时间】:2013-04-22 10:18:46
【问题描述】:
我正在尝试rabbitmq-tutorials,ruby 版本可以正常工作,但 node.js 版本无法发送消息。不知道怎么回事。
var amqp = require('amqp');
var amqp_hacks = require('./amqp-hacks');
var connection = amqp.createConnection({host: 'localhost'});
connection.on('ready', function(){
connection.publish('hello_node', 'Hello World!');
console.log(" [x] Sent 'Hello World!'");
amqp_hacks.safeEndConnection(connection);
});
在我运行node send.js 之后,运行进程node recv.js 无法接收任何内容。而rabbitmqctl list_queues 不显示hello_node 队列。
【问题讨论】:
标签: node.js rabbitmq amqp node-amqp