<br><div class="gmail_quote">On Wed, Oct 7, 2009 at 4:02 PM, Alexis Richardson <span dir="ltr">&lt;<a href="mailto:alexis.richardson@gmail.com">alexis.richardson@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Bryan<br>
<br>
I assume each job should be completed at most once.<br></blockquote><div><br>Ideally, yes.� Don&#39;t want to run 2-3 hour jobs more than necessary. :)<br>�</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

You can achieve something almost like what you want by creating two<br>
queues. �Use one for &quot;paying&quot; and one for &quot;non-paying&quot; jobs by binding<br>
each queue to the (direct) exchange using the keys &quot;paying&quot; and<br>
&quot;nonpaying&quot; respectively. �Assign N servers to the &quot;paying&quot; queue.<br>
Let the remainder consume from both queues using some selection scheme<br>
(eg worker randomly chooses a queue each time a new job is needed).<br></blockquote><div><br>I was thinking along those lines, but wanted to make sure I wasn&#39;t missing something obvious.� That will require some coding on our end that I was hoping to avoid.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Many other schemes are possible. �However trying to achieve some total<br>
order (eg &#39;first come first serve&#39;) may be more complex than you<br>
really need.<br>
<br>
alexis<br>
<div><div></div><br></div></blockquote><div><br>Total order isn&#39;t necessary, we just want to make a good faith effort to serve those who&#39;s requests came first.<br><br>I have a related question... BasicConsume has a &quot;filter&quot; parameter.� It&#39;s been a few months since I read the AMQP spec.� I took a quick look online, but couldn&#39;t find any good documentation.� What does that do (if anything) and how do you use it?� <br>
<br>Ideally, what I was originally fishing for was something like this:<br><br>Client:<br>� headers[&quot;paying&quot;] = &quot;true&quot;;<br>� bus.Send(message, headers);<br><br>Server A:<br>� bus.Receive(queue=&quot;jobs&quot;, filter=&quot;paying == &#39;true&#39;&quot;);<br>
<br>Server B:<br>� bus.Receive(queue=&quot;jobs&quot; /* no filter */);<br><br>Thanks,<br>Bryan<br></div></div>