<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><br><meta http-equiv="content-type" content="text/html; charset=utf-8"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit; ">Hum indeed, this is literally our code...<div><br></div><div>So if declare_ok always refers to a new queue, we have no choice but use Runtime.exec("rabbitmqctl list_queues") if we want to know this kind of information on an existing queue? </div><div><div><br></div><div>Cheers,</div><div>Florence.</div></div></td></tr></tbody></table><br><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div id="yiv1311313231"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit;"><div><div><br>--- En date de : <b>Jeu 26.8.10, Simon MacMullen <i><simon@rabbitmq.com></i></b> a
écrit :<br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><br>De: Simon MacMullen <simon@rabbitmq.com><br>Objet: Re: [rabbitmq-discuss] To know when a queue is empty from a Java client<br>À: rabbitmq-discuss@lists.rabbitmq.com<br>Date: Jeudi 26 août 2010, 16h13<br><br><div class="yiv1311313231plainMail">On 26/08/10 15:05, Florence
Chabanois wrote:<br>> Thanks for your answer !<br>><br>> We may be using it in a wrong way but so far, the method<br>> getMessageCount() always displays 0 message, when /"rabbitmqctl<br>> list_queues"/ displays 8 messages or keeps growing.<br>><br>> DeclareOk declareOk = channel.queueDeclare();<br><br>That's declaring a *new* server-named queue - which has 0 messages in <br>it. Is that literally your code, or a paraphrase?<br><br>Cheers, Simon<br><br>> System.out.println(">>>> MESSAGES : " + declareOk.getMessageCount());<br>><br>><br>> Cheers,<br>> Florence.<br>><br>> --- En date de : *Jeu 26.8.10, Michael Bridgen /<<a rel="nofollow">mikeb@rabbitmq.com</a>>/* a<br>> écrit :<br>><br>><br>> De: Michael Bridgen <<a rel="nofollow">mikeb@rabbitmq.com</a>><br>> Objet: Re:
[rabbitmq-discuss] To know when a queue is empty from a<br>> Java client<br>> À: <a rel="nofollow">flocha2000-agile@yahoo.fr</a><br>> Cc: <a rel="nofollow">rabbitmq-discuss@lists.rabbitmq.com</a><br>> Date: Jeudi 26 août 2010, 15h24<br>><br>> > From a Java client we need to know when a queue is empty.<br>> > Is there a way to know it via the Java api (or to know the number<br>> > of messages in a queue).<br>> ><br>> > We would rather
have another way than calling /"rabbitmqctl<br>> list_queues"/<br>> > via Runtime.exec()<br>><br>> A queue.declare_ok frame includes the number of messages on the<br>> queue; so, you could send a passive queue.declare, and examine the<br>> response.<br>><br>> Regards,<br>> Michael<br>><br>><br>><br>><br>> _______________________________________________<br>> rabbitmq-discuss mailing list<br>> <a rel="nofollow">rabbitmq-discuss@lists.rabbitmq.com</a><br>> <a rel="nofollow" target="_blank" href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br><br><br>-- <br>Simon
MacMullen<br>Staff Engineer, RabbitMQ<br>SpringSource, a division of VMware<br><br>_______________________________________________<br>rabbitmq-discuss mailing list<br><a rel="nofollow">rabbitmq-discuss@lists.rabbitmq.com</a><br><a rel="nofollow" target="_blank" href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br></div></blockquote></div></div></td></tr></tbody></table><br>
</div></blockquote></td></tr></table><br>