[rabbitmq-discuss] routing key advice + QueueBind(...)
jerryk at vmware.com
Fri Dec 10 18:45:06 GMT 2010
> are there any good RMQ examples, or documentation for routing keys?
Which client are you using? The Java API user's guide has some concise examples of the nitty-gritty on creating exchanges, bindings and routing keys:
The theory of operation for routing keys is explained in the FAQ around here:
Below I've added some more specific pointers to FAQ sections you might find helpful.
Also, the unit tests for the Java client contain examples you might find useful as starting points and inspiration. You'd want to download the "source code and tools" distributions of the Java client from: http://www.rabbitmq.com/java-client.html if you haven't already got it.
> On a per node basis, is that three extra channels & 3 extra threads? OR: I figure it'd be easier if these three routing keys were attached to one queue. Is there a secret comma operator for routing keys that I'm not aware of for use with QueueBind? If I call QueueBind three times, will the result be cumulative?
You can declare multiple routing keys for a single queue. Please, consult the FAQ entries below and certainly drop us another note if those don't help:
and its immediate predecessors in the FAQ. Creating separate bindings for each key you're interested in, as you suggest, is the right thing to do.
> Are channels expensive on the RMQ server? How about on the client side?
Channels are designed to be pretty cheap, whereas connections aren't because there's an actual TCP connection behind each one. Multiplexing many channels to one connection lets us avoid duplicating the really heavyweight part.
More information about the rabbitmq-discuss