<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Getting the message count only appears to get updated when you declare the queue. What if you wanted to poll the queue and see how many messages were on it every 15 seconds or so? Creating a new binding to the queue just to get the message count seems a bit expensive. <div><br class="webkit-block-placeholder"></div><div>The main reason for wanting the message count is so that we can determine if we need to bring more consumer instances online when we're getting hammered (EC2 instances currently).</div><div><br class="webkit-block-placeholder"></div><div>thx,</div><div>-matt</div><div><br><div><div>On Nov 5, 2007, at 10:20 AM, Matthias Radestock wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Matt,<br><br>matt wrote:<br><blockquote type="cite">First off, I want to say how much we love amqp and rabbitMQ!<br></blockquote><br>Thank you. It is always nice to hear from real users.<br><br><blockquote type="cite">We've ( meez.com) been using it in our production environment (when<br></blockquote><blockquote type="cite">it was alpha) for about 6 months now I think.<br></blockquote><blockquote type="cite">In brief, we use rabbitMQ as a way of communicating with our<br></blockquote><blockquote type="cite">rendering cluster. We have user facing tomcat servers that provide a<br></blockquote><blockquote type="cite">way of giving the user options to create an avatar. Upon save, we<br></blockquote><blockquote type="cite">send export requests via rabbitMQ and they're picked up by nodes in<br></blockquote><blockquote type="cite">the export cloud. Upon success of the rendered images, a<br></blockquote><blockquote type="cite">notification is sent back and the user is notified that the exports<br></blockquote><blockquote type="cite">were successful.<br></blockquote><br>That is a pretty neat use case, and it is good to hear that RabbitMQ<br>worked out well for you.<br><br><blockquote type="cite">the big immediate need we're looking for is a way to see how much is<br></blockquote><blockquote type="cite">being queued up on the rabbitMQ cluster. That way, we can<br></blockquote><blockquote type="cite">programatically bring EC2 nodes up or take then down based on need.<br></blockquote><blockquote type="cite">I know that this is in the pipeline - but is there *any* way of doing<br></blockquote><blockquote type="cite"> this now and/or is there something that could be easily added to support this?<br></blockquote><br>queue.declare-ok, the result of a queue.declare operation, in one of its fields contains the number of messages in the queue. This is part of the amqp 0-8 spec and implemented by RabbitMQ. In combination with queue.declare's passive flag it allows you to determine the length of existing queues.<br><br>If you are using the RabbitMQ Java client, check out<br><a href="http://www.rabbitmq.com/javadoc/com/rabbitmq/client/impl/ChannelN.html#queueDeclare(int,%20java.lang.String,%20boolean,%20boolean,%20boolean,%20boolean,%20java.util.Map)">http://www.rabbitmq.com/javadoc/com/rabbitmq/client/impl/ChannelN.html#queueDeclare(int,%20java.lang.String,%20boolean,%20boolean,%20boolean,%20boolean,%20java.util.Map)</a>,<br> and<br><a href="http://www.rabbitmq.com/javadoc/com/rabbitmq/client/impl/AMQImpl.Queue.DeclareOk.html#getMessageCount()">http://www.rabbitmq.com/javadoc/com/rabbitmq/client/impl/AMQImpl.Queue.DeclareOk.html#getMessageCount()</a><br><br>This is only a very limited interface - you need to know the names of queues and you only get a report on the number of messages, not their storage size etc - but perhaps that is sufficient for your needs?<br><br><br>Hope this helps, and thank you for using RabbitMQ,<br><br><br>Matthias.<br></blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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: 0; "><div><font color="gray" face="Arial" size="2"><span><br class="Apple-interchange-newline">--</span></font><br><a href="http://www.meez.com/"><img src="http://images.meez.com/user05/04/04_10001605581.gif" width="175" height="233" alt="meez" align="left" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "></a><font color="gray" face="Arial" size="2"><span>Matt Darling</span></font><br><font color="gray" face="Arial" size="2"><span>Director, Server Engineering</span></font></div><div><font color="gray" face="Arial" size="2"><span>Meez</span></font><br><font color="gray" face="Arial" size="2"><span>182 2nd Street</span></font><font color="gray" face="Arial" size="2"><span>, 5th Floor</span></font><br><font color="gray" face="Arial" size="2"><span>San Francisco</span></font><font color="gray" face="Arial" size="2"><span>, CA 94105</span></font><br><font color="gray" face="Arial" size="2"><span>(m) 415.505.4623</span></font><br><font color="gray" face="Arial" size="2"><span><a href="mailto:matt@corp.meez.com" target="_blank">matt@corp.meez.com</a></span></font><br></div><br></span><br class="Apple-interchange-newline"> </div><br></div></body></html>