[rabbitmq-discuss] EndOfStreamException SharedQueue closed with .net client
dhickey at gmail.com
Fri Mar 25 10:54:00 GMT 2011
Thanks Emile, that did the trick.
I think section 2.8 of the dotnet user guide may be a bit out of date?
The example there has the line
> consumerChannel.BasicConsume(consumerQueue, null, consumer);
It appears the second parameter is not valid for a bool. It also has
> channel.BasicAck(e.DeliveryTag, false);
So hence my mis-understanding.
Also, I would not hold this code up as a 'correct' example of
anything! I was just trying to get a reproduction of my issue in a
On Mar 25, 10:16 am, Emile Joubert <em... at rabbitmq.com> wrote:
> Hi Dex,
> On 24/03/11 23:13, Dex wrote:
> > Hi all,
> > new to RabbitMQ here :) Version 2.4.0, erlang 5.8.3, win7 x64, .Net 4
> > Learning the API, I've based the code below on the examples in the
> > dotnet client user guide.
> > When run, the Task thread will dequeue the message fine, but will
> > throw when starting to de-queue again:
> The problem is the combination of these two lines:
> > consumerChannel.BasicConsume(consumerQueue, true, consumer);
> > consumerChannel.BasicAck(e.DeliveryTag, false);
> You are consuming from the queue in auto-ack mode and explicitly
> acknowledging the message. This amounts to a duplicate acknowledgement
> which is forbidden. The broker is required by the AMQP specification to
> raise a channel exception in this situation. The exception you see is a
> result of this.
> The solution is either to set the auto-ack flag to false when
> registering the consumer or to remove the explicit acknowledgement.
> You are closing the channel and connection in the wrong order in the
> task, but the previous error prevents this code from being reached.
> In this case you only need a single connection. You can create a
> consumer channel and a producer channel over the same connection. At the
> moment your program won't terminate, because the separate consumer
> connection remains open and the task doesn't know that the main thread
> has terminated.
> rabbitmq-discuss mailing list
> rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
More information about the rabbitmq-discuss