[rabbitmq-discuss] Sent and received message counts don't match

Haldun Bayhantopcu hbayhantopcu at gmail.com
Sun Oct 5 04:20:23 BST 2008


Hi all,

I'm trying to warm myself up with amqp and in particularly rabbitmq.
I wrote some python scripts just to send and receive messages based
on the demos that I've found in py-amqplib's repository. However, I
encounter a situation that I did not expect.

There is a producer script which produces 1000 messages containing
random phrases and sends them to a fanout exchange.[1] It prints the
number of sent messages as 1000, which I think that 1000 messages
delivered successfully to rabbitmq.

There are two consumer scripts[2,3] The first one just tries to
get messages one by one with channel.basic_get(queue_name) resulting
saying that it gets 998 messages. The second one uses a callback
technique which I copied from the demo code. It prints ~500
messages to the screen and seems to be stalled. And for one
reason that I don't understand yet, the second consumer script
fetches messages very fast than the first one.

The codes are using py-amqplib, and their addresses are pasted
below.

Do I make completely wrong at something?

Thanks in advance,
Haldun.

[1] http://pastebin.com/f29a4811
[2] http://pastebin.com/f33fffd26
[3] http://pastebin.com/f7f6f3a45





More information about the rabbitmq-discuss mailing list