[rabbitmq-discuss] How to sanely bind one queue to many exchanges?
pauljones23 at gmail.com
Fri Aug 14 19:52:45 BST 2009
> > Assuming that there is a known identifier for each game (database id,
> > or equivalent), what about using a single direct exchange, with the
> > 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
> > routing keys. If you're considering the clustering scenario, exchange
> > information is replicated to all nodes - so it isn't like there is a
> > 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...
More information about the rabbitmq-discuss