<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><div>Thanks for your answer !</div><div><br></div><div>We may be using it in a wrong way but so far, the method getMessageCount() always displays 0 message, when <i>"rabbitmqctl list_queues"</i> displays 8 messages or keeps growing.</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>DeclareOk declareOk = channel.queueDeclare();</div><div>System.out.println("&gt;&gt;&gt;&gt; MESSAGES : " + declareOk.getMessageCount());</div></blockquote><div><br></div>Cheers,<div>Florence.<br><br>--- En date de&nbsp;: <b>Jeu 26.8.10, Michael Bridgen <i>&lt;mikeb@rabbitmq.com&gt;</i></b> a �crit&nbsp;:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>De: Michael Bridgen &lt;mikeb@rabbitmq.com&gt;<br>Objet: Re: [rabbitmq-discuss] To know when a queue
 is empty from a Java client<br>�: flocha2000-agile@yahoo.fr<br>Cc: rabbitmq-discuss@lists.rabbitmq.com<br>Date: Jeudi 26 ao�t 2010, 15h24<br><br><div class="plainMail">&gt;&nbsp; From a Java client we need to know when a queue is empty.<br>&gt; Is there a way to know it via the Java api (or to know the number<br>&gt; of messages in a queue).<br>&gt; <br>&gt; We would rather have another way than calling /"rabbitmqctl list_queues"/<br>&gt; via Runtime.exec()<br><br>A queue.declare_ok frame includes the number of messages on the queue; so, you could send a passive queue.declare, and examine the response.<br><br>Regards,<br>Michael<br></div></blockquote></div></td></tr></table><br>