> On 31/01/13 12:34 AM, "Frank Zhang" <frank.zh...@citrix.com> wrote: > > > >Sorry, I may have not made my question clear. > >Publisher doesn't have to be aware of consumer, but it must know the > >binding key. > >Now I reread the below statement I think I got your idea is: > >When subscriber subscribes an event, the framework creates the queue > >and notifies binding key to publisher. > > Not quite, at least in the AMQP case. Publisher need not be aware of binding > key also. There is explicit concept of 'routing key' and 'binding key' in > AQMP. > A message is published in the exchange with a routing key. > Its broker responsibility to match the routing key of the message with all the > binding key's associated with the queues. If there is a match of keys, then > message is delivered into queue.
Yes, in theory the string is called as routing key when publisher uses it and as binding key when subscriber uses it. Ok. I reread the thread again, I may have done a wrong assumption that publisher only publishes events subscribed by some subscriber. So I say publisher must know binding key otherwise it doesn't know what routing key to use when calling basicPublish(). >>"*.*.*.VirtualMachine.9d827485-0f46-4db8-bd39-fede97cbac0c". Now it turns out that publisher will publish all events related to a VM no matter if any subscriber interested in it, am I right? In this case, publisher needs not to know binding key as it publishes events using predefined routing key.