<p class="p1">hi,&nbsp;</p><p class="p1">I am a newbie to use a rabbitmq.&nbsp;</p><p class="p1">currently, I am using it without no auto-ack mode.&nbsp;</p><p class="p1">manually, I send &nbsp;ack/nack after receiving messages from queues.</p><p class="p1">but, on this, I found that&nbsp;current queue size is always different with a real queue size. actually, it is always same with actual queue size - prefetch size.&nbsp;</p><p class="p1">here is my code to send.&nbsp;</p><p class="p1">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="s1">channel</span>.basicPublish(<span class="s1">exchangeName</span>, <span class="s1">queueName</span>, <span class="s2"><b>null</b></span>, message);</p>
<p class="p1">&nbsp; &nbsp; &nbsp; &nbsp; System.<span class="s1">out</span>.println(<span class="s1">channel</span>.queueDeclarePassive(<span class="s1">queueName</span>).getMessageCount()); // for debugging</p><p class="p1">If I set the prefetchCount as 5. it prints out&nbsp;</p><p class="p1">0</p><p class="p1">0<br></p><p class="p1">0<br></p><p class="p1">0<br></p><p class="p1">0<br></p><p class="p1">1</p><p class="p1">2</p><p class="p1">3</p><p class="p1">4</p><p class="p1">.....</p><p class="p1">If I set it as 3, it prints out</p><p class="p1">0</p><p class="p1">0</p><p class="p1">0</p><p class="p1">1</p><p class="p1">2</p><p class="p1">3</p><p class="p1">4</p><p class="p1">..</p><p class="p1"><br></p><p class="p1">How could I retrieve the correct queue size regardless of the prefetchCount.</p><p class="p1"><br></p><p class="p1">thanks for your concerns.</p>