[rabbitmq-discuss] helloworld java and .net

Emile Joubert emile at rabbitmq.com
Tue Mar 8 11:00:09 GMT 2011


Hi David,

The problem you describe is caused by the combination of these two lines:

>              channel.BasicConsume(QUEUE_NAME, true, consumer);
>                      channel.BasicAck(e.DeliveryTag, false);

both of which cause messages to be acknowledged. You will see entries 
similar to this in the broker logfile:

{amqp_error,precondition_failed,"unknown delivery tag 1",'basic.ack'}

The most common cause of this message is acknowledging messages more 
than once.

The solution is to consume without autoAck:

                 channel.BasicConsume(QUEUE_NAME, false, consumer);

or remove the explicit basicAck() (this is what all the other 
implementations do).

You may also wish to compare your solution with the (as yet) unpublished 
version in the "dotnet" folder of the github repository.


Regards

Emile



More information about the rabbitmq-discuss mailing list