<br><div class="gmail_quote">On Wed, Feb 2, 2011 at 3:28 AM, James Carr <span dir="ltr">&lt;<a href="mailto:james.r.carr@gmail.com">james.r.carr@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

I&#39;ve been wondering what kind of scheme would be useful for binding<br>
queues to be notified for certain changes in a value. For example, say<br>
I have a stock system that applications can bind to and be notified<br>
if, for excample, IBM&#39;s stock price has risen 2.00 or more, if the<br>
price has dropped more than 2%, etc. What kind of scheme would work<br>
best in this case?<br></blockquote><div><br>If you really need to do this kind of thing through a queue binding, rather than consumer value checks, the only thing that comes to mind is to have the producer band the values, so you can subscribe to bands. For example, have the producer use 1% bands in the routing key, 0 for 0&lt;= x &lt; 1, 1 for 1&lt;= x &lt;2, etc. and then bind your queue to as many ranges as you are interested.<br>
<br>Or you could use a filtering shovel, which does the range checking for you.<br><br>And just in case, you aren&#39;t talking about keeping track of the %-age change? Cause that would involve keeping state in a sliding window and make things a wee bit more complicated.<br>
<br>Robby<br><br></div></div>