<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Georgia; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On Aug 26, 2010, at 9:34 AM, Florence Chabanois wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0" style="position: static; z-index: auto; "><tbody><tr><td valign="top" style="font: inherit;"><br><table cellspacing="0" cellpadding="0" border="0" style="position: static; z-index: auto; "><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></td></tr></tbody></table></blockquote></div><br></div><div>Actually, your code is creating a new queue, so in your example, the declare_ok will always refer to a new queue.</div><div><br></div><div>But if you declare a queue that already exists (which a producer has already populated with messages), you'll get back the message count. Give a name to your queue and have the producer and consumer use the same name.</div><div><br></div><div><div>If you attach your consumer to a new queue (which you're doing by creating an anonymous queue) the message count will obviously be zero because nothing has put messages in it yet.</div><div><br></div><div><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Georgia; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div><div><br>Jon Brisbin</div><div>Portal Webmaster</div><div>NPC International, Inc.</div></div><div><br></div></span></div></div></div></body></html>