[rabbitmq-discuss] Routing algorithm in RabbitMQ

Ben Hood 0x6e6562 at gmail.com
Fri Aug 1 10:22:11 BST 2008


Abhishek,

On Mon, Jul 28, 2008 at 11:52 AM, Ben Hood <ben at lshift.net> wrote:

> Can you please let me know what kind of routing algorithm is being used in
> the server, to match the incoming events with the corresponding queues. I
> think Mnesia is used as the distributed DBMS, but I was just curious to know
> about the routing algorithm and its performance.

I'm answering this by way of the rabbitmq-discuss mailing list,
because you might get some input from the community.

The routing semantics are defined the AMQP spec.

If you have a look inside it, you will find the notion of exchanges,
to which queues can be bound using routing keys.

There are several types of exchanges:

- Direct, i.e. 1:1 or quasi-P2P messaging
- Fanout, i.e. 1:N messaging
- Topic, i.e. hierarchical matching
- Headers, i.e. content based routing
- Custom, i.e. implementation specific exchanges, not defined in the spec

As for the concrete routing algorithm, there's nothing funky about it
I wouldn't say.

As it turns out, I am currently working on a patch to the routing
mechanism, bug 18776 in hg refers, although I haven't done much on it
yet.

I can't much about performance yet, but I think that the routing table
will be tree based, so expect something in the order of O(nlogn)

HTH,

Ben




More information about the rabbitmq-discuss mailing list