Thanks for the reply Gordon , so another question that I had regarding the same topic was about the hello world example and how it is functioning ? In that example , we have a message producer and a consumer the producer sends a message to the default topic exchange amq.topic . Now I am confused with the example primarily because of two reasons: 1-A message is being sent to a default Topic Exchange however no queue has been associated with it ? Dont topic exchanges have topic queues 2-What is the routing key of the message being sent ? since there is no subject in the message isnt the routing key empty ?
I would appreciate it if you could help me understand that. On Thu, Dec 1, 2016 at 7:52 PM, Gordon Sim <g...@redhat.com> wrote: > On 01/12/16 18:46, James Franco wrote: > >> I am trying to wrap my head around the association of topics and queues >> with an exchange. Here is my understanding so far (please correct me if I >> am wrong). In the end I have a question . >> >> Point 1: >> Whenever we create a queue by default it is under the default exchange >> amq.direct.We can move this queue to a different direct exchange using the >> bind command shown below: >> >> ./qpid-config bind NameOfDirectExchange NameOfQueue bindingKey >> >> Now I would like to know more about topics. Whenever we create a topic we >> use the command resembling the one below >> >> ./qpid-config add exchange topic news >> >> Now the above command is basically creating an exchange of topic type. >> >> My question is how can I create a topic without creating a new exchange ? >> Say if I wanted to create a topic under the default exchange amq.topic? >> >> Is it possible for one exchange to have both topics and queues ? I would >> think not because an exchnage can be either Direct , topic , fanout or >> headers am I correct ? >> > > In AMQP 0-10 and earlier, messages are always published to an exchange and > always consumed from queues. > > Exchanges have bindings associated with them. These are just rules on > which queues the exchange should forward (or route) a given message to. > > There are different types of exchange. The exchange type dictates what > form the binding 'rules' can take. For a fanout exchange, a binding to a > queue means that all messages to that exchange should go to that queue. For > a direct exchange, each binding specifies a 'key' that is matched against a > special property (called a routing key) of the message being routed using > an exact match; messages whose routing key is exactly the same as the key > of a binding are routed to the queue that binding is associated with. A > topic exchange also uses a key in its bindings, but the matching allows for > wildcards. > > The 'topic' exchange type is (in my view) an unfortunate choice of name. > You can achieve JMS style 'topic' semantics using any of the exchange > types. The difference is whether you need wildcard matching or not. > > A queue can be bound to more than one exchange, and there can be more than > one binding between a given queue and exchange (providing these bindings > differ in some way, e.g. have a different key). Binding doesn't move a > queue in any way. > > The 'default exchange' is really just a way to give the illusion of being > able to send direct to a queue. The bindings of the default exchange are > guaranteed to route a message whose routing key is the queue name to that > queue (and only that queue). > > Hope this helps a little. There are some better explanations of the > concepts available . Note though that these concepts are specific > to pre 1.0 versions of the AMQP protocol. > >  http://qpid.apache.org/releases/qpid-java-6.1.0/java-broker/ > book/Java-Broker-Concepts-Exchanges.html >  https://www.rabbitmq.com/tutorials/amqp-concepts.html >  https://access.redhat.com/documentation/en-US/Red_Hat_Enterp > rise_MRG/1.1/html/Messaging_User_Guide/chap-Messaging_ > User_Guide-Exchanges.html > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org > For additional commands, e-mail: users-h...@qpid.apache.org > >