I&#39;ve come across a situation that&#39;s semi-obvious in retrospect given what I know of RabbitMQ, but nonetheless escaped me till now.<br><br>I&#39;ve written a variety of automation code in Python using the rabbitmq management API. Things like purging queues, dumping queue contents to files, simulating broker failover, etc...<br>
<br>Today I created a situation where I knew that there was an unacknowledged message in a queue, and I could observe that was the case via the Web UI. However, my code was getting a value of &#39;0&#39; for the messages_unacknowledged column from /api/queues.<br>
<br>I eventually figured out that my HTTP call occurred before the default five second statistics database update. Thus, if I waited a few seconds before issuing the call, I got back the expected value of &#39;1&#39;.<br>
<br>Now, some of my automation depends on the values I get from the HTTP API to be correct &quot;now&quot;, rather than behind by some non-trivial interval.<br><br>Now, I realize that this is an inherently racy circumstance. I&#39;m just trying to reduce the window as much as possible. As I see it, I have three options:<br>
<ul><li>Crank up the default update interval, suppressing perf as I go to smaller intervals</li><li>Somehow query the broker in the same way that rabbitmqctl does. I assume this involves writing Erlang code, which I&#39;d like to avoid for time reasons.</li>
<li>Call rabbitmqctl and capture/parse the output.<br></li></ul>Again, I realize that any solution is inherently only a snapshot in time -� Thoughts on how to best achieve the most recently correct values, ideally in Python and without learning Erlang? :-)<br>
<br>Thanks,<br><br>Matt<br>