[rabbitmq-discuss] How to sanely bind one queue to many exchanges?

Paul Jones pauljones23 at gmail.com
Fri Aug 14 19:52:45 BST 2009

> > Assuming that there is a known identifier for each game (database id,
> guid,
> > or equivalent), what about using a single direct exchange, with the
> routing
> > key being set to the game id each time. When a player connects, they
> > subscribe to the exchange with all of the routing keys for the games that
> > they are interested in.
> Can you subscribe one queue to one exchange with multiple keys, or is
> the idea that each player would use one queue per game?

The one queue can be bound to a single exchange with multiple routing keys;
so each player would only need to have a single queue. Depending on how you
access Rabbit, it might also be worth putting the routing key into the
message body, just to make it a bit more accessible (since some apis don't
provide the easiest access to the routing key).

> > As far as scalability is concerned, using a direct exchange with many
> > routing keys should hopefully be no worse than many fanout exchanges with
> no
> > routing keys. If you're considering the clustering scenario, exchange
> > information is replicated to all nodes - so it isn't like there is a
> single
> > point that all messages need to go through.
> Good to know.  I wasn't too worried about using one direct exchange,
> but using one topic exchange seemed like a bad idea.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20090814/f7819b25/attachment.htm 

More information about the rabbitmq-discuss mailing list