【发布时间】:2011-09-27 20:46:04
【问题描述】:
我一直在使用带有 apache + php 的 RabbitMQ,想看看它与 Node.JS 在性能方面的比较。
使用最新的 node.js (0.4.12) 和 amqp 模块 (npm install amqp),我得到一个未知的异常连接,似乎是帧大小导致错误(amqp.js 中的第 181 行),删除代码中的错误只是引发了另一个与分配过大的数组大小有关的错误。
RabbitMQ 服务器只是一个具有默认配置的“apt-get install rabbitmq-server”。这在 PHP 中工作得很好。
Starting ... AMQP URL: amqp://localhost
events.js:47
throw new Error("Uncaught, unspecified 'error' event.");
^
Error: Uncaught, unspecified 'error' event.
at Connection.emit (events.js:47:15)
at AMQPParser.onError (/nodeJS_stuff/node_modules/amqp/amqp.js:839:12)
at AMQPParser.throwError (/nodeJS_stuff/node_modules/amqp/amqp.js:145:25)
at AMQPParser.execute (/nodeJS_stuff/node_modules/amqp/amqp.js:181:18)
at Connection.<anonymous> (/nodeJS_stuff/node_modules/amqp/amqp.js:851:12)
at Connection.emit (events.js:64:17)
at Connection._onReadable (net.js:672:14)
at IOWatcher.onReadable [as callback] (net.js:177:10)
有人遇到过这种情况吗?我已经尝试了几个例子,我总是得到这个。我也在 EC2 上运行它,如果有帮助的话。
【问题讨论】: