|
|
| Author |
Message |
|
| Guest |
Posted: Wed Oct 07, 2009 8:41 pm |
|
|
|
Guest
|
| We have paying and non-paying customers. |
|
|
| Back to top |
|
| Guest |
Posted: Wed Oct 07, 2009 9:03 pm |
|
|
|
Guest
|
Bryan
I assume each job should be completed at most once.
You can achieve something almost like what you want by creating two
queues. Use one for "paying" and one for "non-paying" jobs by binding
each queue to the (direct) exchange using the keys "paying" and
"nonpaying" respectively. Assign N servers to the "paying" queue.
Let the remainder consume from both queues using some selection scheme
(eg worker randomly chooses a queue each time a new job is needed).
Many other schemes are possible. However trying to achieve some total
order (eg 'first come first serve') may be more complex than you
really need.
alexis
On Wed, Oct 7, 2009 at 9:40 PM, Bryan Murphy <bmurphy1976@gmail.com> wrote:
> We have paying and non-paying customers. |
|
|
| Back to top |
|
| Guest |
Posted: Wed Oct 07, 2009 9:18 pm |
|
|
|
Guest
|
On Wed, Oct 7, 2009 at 4:02 PM, Alexis Richardson <alexis.richardson@gmail.com (alexis.richardson@gmail.com)> wrote:
Quote: Bryan
I assume each job should be completed at most once.
Ideally, yes. |
|
|
| Back to top |
|
| tonyg |
Posted: Thu Oct 08, 2009 2:08 pm |
|
|
|
User
Joined: 07 Nov 2006
Posts: 199
|
But to answer your question, Bryan:
Bryan Murphy wrote:
> I have a related question... BasicConsume has a "filter" parameter.
> It's been a few months since I read the AMQP spec. I took a quick look
> online, but couldn't find any good documentation. What does that do (if
> anything) and how do you use it?
It is unspecified. QPid, I believe, uses it to implement JMS-style
message selectors. We don't currently do anything with it (mostly
because of the question "how on earth should one interpret what's put in
there anyway"). I think people were headed in the direction of
specifying some kind of SQL92-like predicate language for use there. Ick.
> Ideally, what I was originally fishing for was something like this:
>
> Client:
> headers["paying"] = "true";
> bus.Send(message, headers);
> Server A:
> bus.Receive(queue="jobs", filter="paying == 'true'");
> Server B:
> bus.Receive(queue="jobs" /* no filter */);
Yes I think that was the original intent. For now, consider it for
experimental use only, I suppose.
(For your use case, what's to stop people falsely advertising that they
are paying customers when they submit jobs? Hmm that reminds me of the
idea of getting the broker to securely annotate messages with some
unforgeable ID stamp that was discussed on this list some time ago...)
Tony
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|