Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 80660200BD4 for ; Thu, 1 Dec 2016 20:52:59 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7F1F6160B0B; Thu, 1 Dec 2016 19:52:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C6F93160B05 for ; Thu, 1 Dec 2016 20:52:58 +0100 (CET) Received: (qmail 6640 invoked by uid 500); 1 Dec 2016 19:52:57 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 6625 invoked by uid 99); 1 Dec 2016 19:52:57 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2016 19:52:57 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 277CFCC2C5 for ; Thu, 1 Dec 2016 19:52:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -8.02 X-Spam-Level: X-Spam-Status: No, score=-8.02 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id vhdK8huwlofP for ; Thu, 1 Dec 2016 19:52:55 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 830175FC1F for ; Thu, 1 Dec 2016 19:52:54 +0000 (UTC) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E5931FB0B for ; Thu, 1 Dec 2016 19:52:53 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-231.phx2.redhat.com [10.3.116.231]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uB1JqqZ1023028 for ; Thu, 1 Dec 2016 14:52:52 -0500 Subject: Re: Understanding Topics and Queues association with Exchanges To: users@qpid.apache.org References: From: Gordon Sim Organization: Red Hat UK Ltd, Registered in England and Wales under Company Registration No. 3798903, Directors: Michael Cunningham, Michael O'Neill, Eric Shander Message-ID: <2ab8b206-5563-38bc-19c1-7cafe6e3944e@redhat.com> Date: Thu, 1 Dec 2016 19:52:52 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 01 Dec 2016 19:52:53 +0000 (UTC) archived-at: Thu, 01 Dec 2016 19:52:59 -0000 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 [1][2][3]. Note though that these concepts are specific to pre 1.0 versions of the AMQP protocol. [1] http://qpid.apache.org/releases/qpid-java-6.1.0/java-broker/book/Java-Broker-Concepts-Exchanges.html [2] https://www.rabbitmq.com/tutorials/amqp-concepts.html [3] https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_MRG/1.1/html/Messaging_User_Guide/chap-Messaging_User_Guide-Exchanges.html --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org