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

Nathan Gray n8gray at n8gray.org
Fri Aug 14 20:41:33 BST 2009


On Fri, Aug 14, 2009 at 11:52 AM, Paul Jones<pauljones23 at gmail.com> wrote:
>
>> > 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).

Cool!  That should solve my problem.  I think I'm ready to write a bit
of code.  BTW, I'd appreciate any pointers on using the C client code
from anybody who's had experience with it.

Thanks Paul, you've been very helpful.  :)
Cheers,
-n8

-- 
http://n8gray.org




More information about the rabbitmq-discuss mailing list