On Fri, 2 Dec 2016 at 00:01, James Franco <[email protected]> wrote:
> yes it is the qpid hello world example . In your statement > > "The binding used depends on the topic type (which the client determines by > asking the broker) and the subject (or other details of the address). Since > no 'subject' is specified by default in hello world, and the exchange type > is a 'topic' exchange that supports wildcarding, the key used for the > binding is '#' which matches anything."address). Since no 'subject' is > specified by default in hello world, and the exchange type is a 'topic' > exchange that supports wildcarding, the key used for the binding is '#' > which matches anything." > > Does that mean if a listener is listening to a TopicExchange instead of a > queue then it is bound to all the queues of the exchange (i.e the listener > will get whatever goes through the exchange to other queues) ? > By definition a listener (consumer) in AMQP 0.x can only listen (consume) from a queue (there is no way to listen to an exchange). The addressing syntax used by the clients is an attempt to abstract away from the implementation details (queues and exchanges) into more common notions such as topics. If you subscribe to an address like foo/bar which you expect to provide topic like semantics... then what the client will be doing under the covers is creating a temporary queue, binding that to the exchange foo with the binding key bar and then listening for message arrivals into that temporary queue. Similarly subscribing to just amq.topic will bind (with a wildcard) a temporary queue which will receive all messages sent to the exchange. One thing that is very misleading in all this is that there is nothing specifically "topic" like about the topic exchange... it would have much better been called the wildcard exchange. You can equally well get topic like behavior from any of the other exchange types -- Rob
