Return-Path: X-Original-To: apmail-qpid-users-archive@www.apache.org Delivered-To: apmail-qpid-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 74D8A9526 for ; Fri, 13 Jan 2012 12:25:13 +0000 (UTC) Received: (qmail 76840 invoked by uid 500); 13 Jan 2012 12:25:12 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 76729 invoked by uid 500); 13 Jan 2012 12:25:06 -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 76207 invoked by uid 99); 13 Jan 2012 12:24:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jan 2012 12:24:53 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.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; Fri, 13 Jan 2012 12:24:46 +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.14.4/8.14.4) with ESMTP id q0DCOPW4011173 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 13 Jan 2012 07:24:25 -0500 Received: from [10.3.232.129] (vpn-232-129.phx2.redhat.com [10.3.232.129]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q0DCOObM007875 for ; Fri, 13 Jan 2012 07:24:24 -0500 Message-ID: <4F102265.1030900@redhat.com> Date: Fri, 13 Jan 2012 12:24:05 +0000 From: Gordon Sim Organization: Red Hat UK Ltd, Registered in England and Wales under Company Registration No. 3798903, Directors: Michael Cunningham (USA), Mark Hegarty (Ireland), Matt Parsons (USA), Charlie Peters (USA) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Lightning/1.0b1 Thunderbird/3.0.10 MIME-Version: 1.0 To: users@qpid.apache.org Subject: Re: Uncanny differences References: <74191BABCAD840C28D6B5D86AC719249@airdice.com> In-Reply-To: <74191BABCAD840C28D6B5D86AC719249@airdice.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 On 01/13/2012 05:19 AM, Kalle wrote: > Hi, > > Java client, cpp broker. > > When I do (a bit of a pseudocode here, I'll post with actual examples if necessary) > > Topic t = session.createtopic("yyy"); > MessagePublisher p = session.createPublisher(t); > > MessageSubscriber s = session.createSubscriber(t); > > > things work. But when I do: > > Topic t = session.createtopic("xxx/yyy"); > MessagePublisher p = session.createPublisher(t); > > MessageSubscriber s = session.createSubscriber(t); > > > they don't. What I see is that when I define my topic with a /, in order to use my own exchange, not all consumers get my messages. Messages seem to go to just one consumer (which ever got the message first). This would mean that they are in fact listening in a totally different pattern, than in the first case (topic with default exchange). > > Why does it work like this? Is this a bug, or a feature I've yet to learn to like? :) Here is what I think is happening, perhaps someone more familiar with the evolution of code in question can confirm or refute this and provide some context... If you don't have a '/' (or a ';') in the string passed to the createTopic() method, the string is used as the routing key and amq.topic is used as the exchange. (That was a surprise to me). If you do have one of those characters, the string is interpreted as an address (or a binding 'URL', based on settings). My guess is that the address xxx/yyy is resolving to a queue named xxx, and that is causing the distribution pattern you are seeing (competing consumers where the first consumers prefetch means it gets the bulk of the messages sent). Is there a queue named xxx on your broker? If that is what is happening, you could try 'xxx/yyy; {node:{type:topic}}' which explicitly states the node should be a topic. As to whether it is a bug, it is certainly confusing behaviour. You could reasonably assume that the destination returned from createTopic() is always a topic(!). We certainly need the behaviour to be clearly explained somewhere. --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:users-subscribe@qpid.apache.org