Search code examples
haskellrabbitmqamqp

AMQP losing a tail of a queue?


I've made some tutorialish script to work out RabbitMQ/Haskell binding and there's a strange message loss occuring. Independently of burst length, receiving side drops a small amount of queued messages. I find it very unbelievable for a consumer to "sense" an end of data burst and give up, but that's how it looks like to me. And the next burst starts happily, without pulling in "unreceived" stuff.

The code and sample results: https://gist.github.com/3859009.

Nothing fancy there, just one consumer and one producer. I've tried to flush stdout, but without success.


Solution

  • Tracing plugin logs shown that it's actually a sending issue.

    Inspecting /var/log/rabbitmq/[email protected] yielded some warnings about dropped connections:

    =WARNING REPORT==== 10-Oct-2012::10:21:45 ===
    closing AMQP connection <0.21203.0> (127.0.0.1:58180 -> 127.0.0.1:5672):
    connection_closed_abruptly
    

    I've checked out my code and, indeed, there was no closeConnection conn in a doFlood routine. Adding it resolved the issue.