Open tom-wr opened 12 years ago
Hi there. My guess is, in the second method, you send the message before the queue is bound to the exchange. Therefore, the difference is in the time it takes for the queue to bind and subscribe. Remeber, node is asynchronous most of the time, so the actual order of events (or could be):
I'm running RabbitMQ v2.8.5 with node.js v0.8.6 and the amqp-node client. I've set up a simple publish/consume test in two different ways each produces a different latency and I can't work out why. The latency was measured from the time the message was sent to the time it was delivered.
The first method uses two separate processes - one for the publishing app - one for the consuming app. It produces a latency of about at 4ms. The second method uses just one app to produce and consume. This produces a latency of about 40ms.
I have output from wireshark looking something similar to:
Method #1 Producer:
Method #1 Consumer
Method #2 Producer and Consumer