Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 32350 invoked from network); 21 Jul 2006 21:17:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Jul 2006 21:17:55 -0000 Received: (qmail 60368 invoked by uid 500); 21 Jul 2006 21:17:54 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 60357 invoked by uid 500); 21 Jul 2006 21:17:54 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 60340 invoked by uid 99); 21 Jul 2006 21:17:54 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jul 2006 14:17:54 -0700 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of sridharkomandur@gmail.com designates 66.249.92.169 as permitted sender) Received: from [66.249.92.169] (HELO ug-out-1314.google.com) (66.249.92.169) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jul 2006 14:17:53 -0700 Received: by ug-out-1314.google.com with SMTP id m2so1533749uge for ; Fri, 21 Jul 2006 14:17:31 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=hcJVZgdTxjd2qmvLictdXoVQMsPaglWnPVfkDOGwbaX2/0xQTglnuqFWcgGoHPeKSgtBGjQKL5pnMbJM8OGDg1HpANGnfZqwA88GTHoZ6UVqOJjGeareKgdZP8aO/OPm++poj4o8caFupJiQRiQdLgkle8lZEcjP13q4PTbc6ok= Received: by 10.78.195.9 with SMTP id s9mr595282huf; Fri, 21 Jul 2006 14:17:31 -0700 (PDT) Received: by 10.78.69.20 with HTTP; Fri, 21 Jul 2006 14:17:31 -0700 (PDT) Message-ID: Date: Fri, 21 Jul 2006 14:17:31 -0700 From: "Sridhar Komandur" Sender: sridharkomandur@gmail.com To: activemq-users@geronimo.apache.org Subject: Re: Virtual Topics (was Re: Failover topic subscribers) In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_116648_7655045.1153516651169" References: X-Google-Sender-Auth: b6d18a9951389581 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_116648_7655045.1153516651169 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, Thanks for the Virtual Topic feature. We have a need for this feature now. Any ETA on this feature ? Please let me know, if I can contribute in anyway to expedite the work. Thanks Regards - Sridhar Komandur On 7/14/06, James Strachan wrote: > > I thought I'd change the subject as really we are discussing a kind of > Virtual Topics where folks can use Queues to subscribe and consume > from them etc... > > > On 7/13/06, bmadigan wrote: > > > > This is almost working, > > YAY! > > > there are a few things I need to fix: > > - Need to figure out how to add the new Broker to the factory without > using > > the plugin loader > > I was thinking, we should maybe add the Virtual Topic interceptor to > the broker by default, but allow the configuration to be overridden in > the activemq.xml as I can't help think it's be great to be able to use > it out of the box. > > We've already got the "ActiveMQ.Advisory." prefix in topics to be used > for advisories. So how about we use ActiveMQ.Virtual. as the prefix > for the default prefix for virtual topics & we let folks customize > this if they don't like the defaults? > > So we should maybe add a VirtualDestinationPlugin property on the > BrokerService which is created by default (unless explicitly disabled > using a bean property) which would auto-default to a sensible default > that could be overloaded- or forks could set the virtual destinations > to something else if they prefer etc. > > > > - It may not be a problem, but I'm synchronizing on next when I create > the > > queues for the virtual groups in addConsumer(). This could be finer > grained > > I think. > > Am not sure if you need to do that; I think the default mechanism of > clients consuming on the queue with the destination auto-created on > the fly would be fine? > > > > - I'm calling ConsumerInfo.setDestination(virtualQueue) to point the > > consumer to a virtual queue. This is probably incorrect, not sure if > there > > is a better way. > > Are you trying to transform a durable topic consumer into a queue > consumer? Am not sure you need. Am thinking if you are a topic > consumer (durable or non-durable) then we leave you as you are; a > fully JMS compliant durable topic consumer. However to use the nice > queue-centric virtual topics, you really use a queue consumer of the > right name and things all just work. (BTW the topic regions are > optimised so that if no consumers are available, publishing to a topic > is a no-op) > > > > - The virtual queues can't provide subscription recovery. Not sure how > to > > handle that. > > Yeah thats true. Am not too worried about that right now - but we > could look at fixing that later on. > > > > I created a BrokerFilter subclass which overrides addConsumer() and > send(): > > > > public Subscription addConsumer(ConnectionContext cc, > > ConsumerInfo ci) throws Exception { > > synchronized(next){ > > String name = ci.getDestination().getPhysicalName(); > > if(name.startsWith(VIRTUAL)){ > > Set destinations = getDestinations( > > new ActiveMQQueue(name)); > > if(destinations.size()==0){//create a new virtual queue > > ActiveMQQueue queue = new ActiveMQQueue( > > name+"?consumer.exclusive=true"); > > next.addDestination(cc,queue); > > ci.setDestination(queue); > > }else{ //queue exists, add the consumer > > ActiveMQQueue queue = (ActiveMQQueue) > > destinations.iterator().next(); > > ci.setDestination(queue); > > } > > } > > } > > return next.addConsumer(cc, ci); > > } > > > > public void send(ConnectionContext ctx, > > Message message) throws Exception { > > String topic = message.getDestination().getPhysicalName(); > > Iterator destinations = getDestinations( > > new ActiveMQQueue(VIRTUAL + ".*." + topic)).iterator(); > > while(destinations.hasNext()){ > > Destination dest = (Destination) destinations.next(); > > dest.send(ctx, message); > > } > > next.send(ctx, message); > > } > > > > Except for the subscription recovery part, this seems to work. > > Looks great - though am thinking we only really need the send() part - > as the other stuff like adding consumers should just work out side the > box (unless I'm missing something). > > BTW do you want to submit a patch, then we can start wiring this stuff > in? Great work though - am excited to see this stuff implemented! :) > > -- > > James > ------- > http://radio.weblogs.com/0112098/ > ------=_Part_116648_7655045.1153516651169--