[rabbitmq-discuss] Message routing

Tony Garnock-Jones tonyg at lshift.net
Mon Nov 26 16:42:46 GMT 2007

Hi John,

John Watson wrote:
> OK - I've successfully got simple enqueue and dequeue working against a
> single queue.


> Next question, can you point me at some documentation
> that explains how message routing works (or if not yet implemented,
> where it lives in the roadmap, and how it's maybe expected to work)?

Routing is implemented for

 - fanout
 - direct
 - topic

exchanges, all of which are documented in the AMQP 0-8 specification.
sections 2.1.3 and 3.1.3.

The API for all this is largely in the interaction of exchangeDeclare(),
queueBind(), and basicPublish().

> Ideally I'd like to be able to do content-based-routing based (say) on
> XPath expressions into XML content.

There is no XPath exchange defined by AMQP 0-8. If you can shoehorn your
routing into routing-keys, then maybe direct or topic exchanges will
server your purpose; otherwise, I'm afraid you're stuck with simulating
a router at an application level:

      exchange ---> app-level router's queue
                        Java application doing
                           xpath-based routing
                             / | \
                            V  V  V
                      exchanges, queues that are
                      actual targets

So messages enter the broker, leave the broker, are routed, and are
delivered again.

The xpath-router can be implemented in Java or Erlang. If it's
implemented in Erlang, it can be colocated on the broker's node.

If it's implemented in erlang, we can go even further, and make it an
experimental exchange type: we could get some experience with xpath
exchanges, which could then subsequently be proposed for standardisation...

 [][][] Tony Garnock-Jones     | Mob: +44 (0)7905 974 211
   [][] LShift Ltd             | Tel: +44 (0)20 7729 7060
 []  [] http://www.lshift.net/ | Email: tonyg at lshift.net

More information about the rabbitmq-discuss mailing list