-- Ben, are you supplying the correct deliveryTag to the BasicAck?<br><br>Yes, I&#39;m passing into BasicAck the DeliveryTag property on the BasicDeliverEventArgs class that is returned from the Dequeue method.<br><br>Kind Regards,<br>
<br>Ben<br><br><div class="gmail_quote">On Fri, Nov 11, 2011 at 9:33 PM, Simone Busoli <span dir="ltr">&lt;<a href="mailto:simone.busoli@gmail.com">simone.busoli@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<p>Ben, are you supplying the correct deliveryTag to the BasicAck?</p>
<div class="gmail_quote"><div><div class="adm"><div id="q_133949f9959662d3_1" class="ajR h4"><div class="ajT"></div></div></div><div class="h5">On Nov 11, 2011 6:44 PM, &quot;Ben Lewis&quot; &lt;<a href="mailto:stuckinwigan@gmail.com" target="_blank">stuckinwigan@gmail.com</a>&gt; wrote:<br type="attribution">
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="adm"><div id="q_133949f9959662d3_3" class="ajR h4"><div class="ajT"></div></div></div><div class="h5">

Hi <span>Emile,<br><br>Thanks for the response. Here&#39;s the output with from the rabbitmqctl command at different stages:<br><br>First, with me ack&#39;ing the messages:<br><br>Prior to starting consumer<br>
------</span><span>------</span><span>------</span><span>------</span><br><span>Listing queues ...<br>Test.ItemProcess��� 67645��� 0<br>...done.<br><br>As consumer is consuming, just reboot rebooting broker<br>
</span><span>------</span><span>------</span><span>------</span><span>------</span><br><span>Listing queues ...<br>Test.ItemProcess��� 42936��� 1<br>...done.<br><br>After broker rebooted and RabbitMQ started<br>
</span><span>------</span><span>------</span><span>------</span><span>------</span><br><span>Listing queues ...<br>Test.ItemProcess��� 67645��� 0<br>...done.<br><br>With
 noack=true the messages are delivered to the client quicker than I can 
reboot the broker, but when it comes back up the queue is empty with 0 
unacknowledged messages.<br>
<br>
</span>I&#39;m not using transactions (I put a seperate console app together
 to test this) and I do want to persist and acknowledge the message. 
I&#39;ve stepped through my code in debug and its hitting the BasicAck 
method.<br>
<br>Kind Regards,<br><br>Ben<br><br><div class="gmail_quote">On Fri, Nov 11, 2011 at 4:10 PM, Emile Joubert <span dir="ltr">&lt;<a href="mailto:emile@rabbitmq.com" target="_blank">emile@rabbitmq.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Ben,<br>
<div><br>
On 11/11/11 15:12, Ben Lewis wrote:<br>
&gt; I have got a direct exchange feeding a durable queue, if I load say<br>
&gt; 50,000 messages onto the queue and then start a consumer to work through<br>
&gt; those item&#39;s.<br>
&gt;<br>
&gt; My consumer creates the connection, then creates the model (I&#39;m using<br>
&gt; .NET) and sets the Qos prefetch count to 1, then calls BasicGet,<br>
&gt; processes the message, sends an ack (BasicAck), then enumerates until<br>
&gt; BasicGet returns null. Finally disposing the model and closing the<br>
&gt; connection.<br>
<br>
</div>You don&#39;t need to set QoS if you retrieve messages synchronously<br>
(BasicGet). QoS makes sense with BasicConsume. That is not the cause of<br>
your trouble though.<br>
<div><br>
&gt; If I restart the host I have the RabbitMQ broker running on (Windows)<br>
&gt; after processing and ack&#39;ing 40,000 messages while my consumer is<br>
&gt; working through the remaining items, when the RabbitMQ broker comes back<br>
&gt; online the 40,000 messages are redelivered (even though they were<br>
&gt; acknowledged).<br>
&gt;<br>
&gt; Is this supposed to happen?<br>
<br>
</div>No. Acknowledged messages are forgotten about by the broker, so you<br>
should not be seeing them again. What is the output of<br>
<br>
rabbitmqctl list_queues name messages_ready messages_unacknowledged<br>
<br>
before and after the restart? Is it possible that you are somehow not<br>
acknowledging the messages? Do you get the same result if you use the<br>
noAck flag of BasicGet?<br>
<br>
If you are using transactions and failing to commit the transaction then<br>
you could see apparently acknowledged message reappearing - is that a<br>
possibility?<br>
<div><br>
&gt; If this is by design, any suggestions or advice on how I can minimise<br>
&gt; the number of redelivered messages if the broker dies/restarts?<br>
<br>
</div>If you don&#39;t care about persisting messages then you can publish the<br>
messages in non-persistent mode (set the delivery mode in the basic<br>
properties to 1).<br>
<span><font color="#888888"><br>
<br>
-Emile<br>
</font></span></blockquote></div><br>
<br></div></div>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div>
</blockquote></div><br>