I have the latest version of nodejs (0.10.21, amqplib (0.1.0)(https://github.com/squaremo/amqp.node.git) and rabbitmq (3.2.0).
- start rabbitmq-server
- go to amqp.node/examples/tutorials and run ./send.js after installing npm packages.
it reports:
[x] Sent 'Hello World!'
From the rabbitmq web console, I can see it creates the connection, it creates the queue 'hello'. However it doesn't actually publish any message to the queue.
None of the other tutorials work for me except for the RPC client/server - they will create exchanges, queues and channels, but not publish messages.
One of my friends has it running fine using all the same versions except for OS X 10.6 rather than 10.8.
I've stepped through the amqplib code using node inspector and can't see any obvious errors. It did look like the message frame wasn't being created, but at that level I have no real idea what is going on at the moment.
When I publish messages via the web console or with Bunny + Ruby, it creates a queue AND publishes a message as expected, so it must be some problem with node, amqp and/or OS X 10.8 rather than rabbitmq.
The rabbitmq logs (tailing both logs) only mention the connection opening and then closing very quickly afterwards, but doesn't report any errors:
=INFO REPORT==== 27-Oct-2013::20:46:16 === accepting AMQP connection <0.731.0> (127.0.0.1:56927 -> 127.0.0.1:5672)
=INFO REPORT==== 27-Oct-2013::20:46:16 ===
closing AMQP connection <0.731.0> (127.0.0.1:56927 -> 127.0.0.1:5672)
I've sniffed the packets being sent from amqp node to rabbitmq. This from amqp.node running the first example 'send.js' in examples/tutorials:
http://www.limorph.com/files/amqp_amqnode_send.txt
You can see how it opens the connection, creates the queue and closes the connection, but doesn't sent a message.
This one is from ruby/bunny - you can see how it opens the connection, creates the queue, and publishes the message.
http://www.limorph.com/files/amqp_bunny.txt
I've found that if I remove conn.close(), it manages to publish the message.
eg
})).ensure(function() {
// conn.close();
});;
Not really a solution, but it points to maybe the problem being in 'when' rather than amqplib ?
Any ideas or help greatly appreciated