[rabbitmq-discuss] Load balancing with multiple consumers on a single queue

Alexis Richardson alexis.richardson at cohesiveft.com
Fri Aug 1 06:29:09 BST 2008


Nathan

Let me take a chunk of this - but not the Basic.reject part.

On Fri, Aug 1, 2008 at 5:17 AM, Nathan Oorloff <nathan at comvine.com> wrote:
>
> Alexis: although your solution isn't ideal, the amount of processing a task
> requires is roughly related to the size so that might be a good option.
> Where can I find the options for doing the advanced routing rules? So far
> I've only seen routing based on the routing_key property.

The question is whether the existing routing rules are advanced
enough.  I argue that, with Topic Exchanges, they are.

It would not be hard to write a custom exchange which routed messages
based on their size.  The thing is that you would still need a
routing_key as well.  Or rather: if the custom exchange only *ever*
routed based on size, and ignored keys, your solution could be hard to
maintain as you sent more and more messages.  On the other hand you
could perform the size check at the application layer, ie on the
sender, and include size information in the routing keys.  That would
make it easier to treat all routing logic in a uniform way even in a
large scale app.

For example:

accounts.london.largetask.100
accounts.paris.smalltask.2

... could be routed with a Topic Exchange.

My point is that if you use keys at all for this, then you may as well
use them for all of it, and send size info as a key.  Then you do not
need to write a new exchange and can reuse existing application level
tools to maintain your routing logic over time.

Do others agree?  Share your thoughts ;-)

alexis




More information about the rabbitmq-discuss mailing list