[rabbitmq-discuss] .NET Client Library Shared Queue Closed Error on Subscription When No Msgs in Queue

Matthias Radestock matthias at lshift.net
Sun Mar 30 12:24:08 BST 2008


Bill,

BillC wrote:
> Please can you help me with the following error.  Using the examples
> that come with the .NET Cllient Library I have written a small
> program that creates a subscription and reads any published messages
> in the queue.  The code works and reads any messages in the queue,
> however when there are no more messages left to read in the Queue or
> when you run the program without any messages in the queue (i.e. when
> the queue is empty) the connection simply closes and throws the
> following EndOfStreamException:
> 
> System.IO.EndOfStreamException: SharedQueue closed at
> RabbitMQ.Util.SharedQueue.EnsureIsOpen() at
> RabbitMQ.Util.SharedQueue.Dequeue() at
> ConsoleApplication2.Program.Main(String[] args) in
> C:\rabbitmqdotnet\testw 
> indowsapp\ConsoleApplication2\ConsoleApplication2\Program.cs:line 47

Your program looks fine; the Dequeue() call should block when there are 
no more messages available.

To track down the problem it would be useful to get a trace of the 
client/server communication with, e.g., the tracer program that ships 
with the RabbitMQ Java client. See 
http://stage.rabbitmq.com/examples.html#tracer


Matthias.




More information about the rabbitmq-discuss mailing list