Return-Path: Delivered-To: apmail-qpid-users-archive@www.apache.org Received: (qmail 60685 invoked from network); 3 Nov 2010 09:35:34 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Nov 2010 09:35:34 -0000 Received: (qmail 54155 invoked by uid 500); 3 Nov 2010 09:36:05 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 53893 invoked by uid 500); 3 Nov 2010 09:36:03 -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 53885 invoked by uid 99); 3 Nov 2010 09:36:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Nov 2010 09:36:01 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=10.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gsim@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Nov 2010 09:35:53 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oA39ZVlj008783 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 3 Nov 2010 05:35:31 -0400 Received: from [10.3.228.67] (vpn-228-67.phx2.redhat.com [10.3.228.67]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oA39ZTX0019185 for ; Wed, 3 Nov 2010 05:35:30 -0400 Message-ID: <4CD12C76.3050307@redhat.com> Date: Wed, 03 Nov 2010 09:33:42 +0000 From: Gordon Sim Organization: Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom.,Registered in England and Wales under Company Registration No. 3798903,Directors: Michael Cunningham (USA), Charlie Peters (USA) and David Owens (Ireland) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc11 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: users@qpid.apache.org Subject: Re: Publish-Subscribe queue question References: <1288278508103-5682939.post@n2.nabble.com> <4CC9936D.80308@redhat.com> <1288280384405-5683098.post@n2.nabble.com> <4CC99A0A.6030104@redhat.com> <1288281194796-5683157.post@n2.nabble.com> <4CC99FC3.6060206@redhat.com> <1288313993558-5684875.post@n2.nabble.com> <4CCAB3F6.1000300@redhat.com> <1288659867794-5695668.post@n2.nabble.com> <4CD07E42.9060404@redhat.com> <1288747777410-5699801.post@n2.nabble.com> In-Reply-To: <1288747777410-5699801.post@n2.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Virus-Checked: Checked by ClamAV on apache.org On 11/03/2010 01:29 AM, zhaoyi0113@gmail.com wrote: > I have read the example for pub-sub pattern. But it doesn't use Topic, it > uses queues. What I want is to use a Topic for pub-sub. For example, if two > subscribers subscribe on one queue, one message will only be delivered to > one subscriber not both of them. How can I set up a Topic in old API? The concept of a 'topic' as JMS defines it does not directly exist in AMQP 0-10. Rather it is constructed by creating an distinct exclusive subscription queue for each subscriber, binding that to an exchange and then subscribing to that queue. Messages published to this exchange then get routed to each subscription queue and thus each subscriber sees each message. The subscribers are not sharing a queue, they each have their own queue. When you use the Qpid JMS client, and you use a Topic, it is doing this work for you. The broker doesn't see a topic being used, it sees a queue created for each subscriber and then being bound to an exchange. The old c++ API did not have that same functionality built in to it, so the application developer needed to go through the steps manually as in the pub-sub example. In the pub-sub example you can start multiple lilsteners and then when you publish messages, each listener will receive every published message it is interested in. This is the same pattern of message flow as generally implied by a JMS Topic, and the brokers view is the same in each case. --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:users-subscribe@qpid.apache.org