[rabbitmq-discuss] Newcomer to Rabbit seeks exchange-type advice

Mark Petrovic mspetrovic at gmail.com
Tue Jan 10 18:28:58 GMT 2012


This note is longer than I thought it would be, but I do not believe
my situation is complicated.

I am a RabbitMQ newcomer and am trying to identify which exchange type
to use for my application.

I have a publisher P that needs to send messages about database table
updates.  A message will bear the name of a single table name,
followed by some opaque application data:


message == tableName | somedata

So consider a simplified database with three tables of interest:  T1,
T2, and T3.

There are two consumers, C1 and C2.

C1 needs to receive all messages concerning tables T1 and T2.

C2 needs to receive all messages concerning tables T2 and T3.

By implication, C1 and C2 must both receive messages about T2, where
their interests overlap.

Ideally, I want to publish to a single exchange, and, therefore, my
consumers also bind to this same single exchange.  I say this because
in fact there are a lot more than three tables to treat - there are
almost 200.  A proliferation of exchanges per-table would be not good.

I am considering a topic or header exchange.

If a header exchange, I was thinking of the publisher P putting the
concerned table name in a "table header" and the consumers binding to
the exchange with an interest in receiving messages with a table
header value equal to T1, T2, or T3 (I believe x-match == any would be
appropriate when the consumer binds).  But some of my readings on
header exhchanges here


suggest that header exchanges may not be as useful as maybe the name
suggests.  Maybe I'm being overly paranoid.

And I consider topic exchanges because I know they admit messages
about T2 consumed by C1 still being available to C2.

Would someone be kind enough to suggest approaches to discern which
type of exchange to use.

Thank you very kindly.


More information about the rabbitmq-discuss mailing list