RabbitMQ c# System.IO.EndOfStreamException

Viewed 4974

I get the following exception when a consumer is blocking to receive a message from the SharedQueue:

Unhandled Exception: System.IO.EndOfStreamException: SharedQueue closed
   at RabbitMQ.Util.SharedQueue.EnsureIsOpen()
   at RabbitMQ.Util.SharedQueue.Dequeue()
   at Consumer.Program.Main(String[] args) in c:\Users\pdecker\Documents\Visual
Studio 2012\Projects\RabbitMQTest1\Consumer\Program.cs:line 33

Here is the line of code that is being executed when the exception is thrown:

BasicDeliverEventArgs e = (BasicDeliverEventArgs)consumer.Queue.Dequeue();

So far I have seen the exception occuring when rabbitMQ is inactive. Our application needs to have the consumer always connected and listening for keystrokes. Does anyone know the cause of this problem? Does anyone know how to recover from this problem?

Thanks in advance.

4 Answers
Related