Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 36669 invoked from network); 9 Feb 2009 21:41:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2009 21:41:48 -0000 Received: (qmail 25226 invoked by uid 500); 9 Feb 2009 21:41:47 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 25201 invoked by uid 500); 9 Feb 2009 21:41:46 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 25190 invoked by uid 99); 9 Feb 2009 21:41:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 13:41:46 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 21:41:31 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LWdsM-0007fP-HO for users@activemq.apache.org; Mon, 09 Feb 2009 13:41:10 -0800 Message-ID: <21922620.post@talk.nabble.com> Date: Mon, 9 Feb 2009 13:41:10 -0800 (PST) From: darrickc To: users@activemq.apache.org Subject: Re: Can someone point me to an example of using a ConsumerEventSource In-Reply-To: <36e91d9d0902090401q3c7d0566lcebf6de99d59c4e0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: darrickspam@gmail.com References: <21882293.post@talk.nabble.com> <36e91d9d0902090401q3c7d0566lcebf6de99d59c4e0@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org That did the trick! Thanks! Dejan Bosanac wrote: > > Hi, > > try starting the ConsumerEvenetSource (ces.start()). > > Cheers > -- > Dejan Bosanac > > Open Source Integration - http://fusesource.com/ > ActiveMQ in Action - http://www.manning.com/snyder/ > Blog - http://www.nighttale.net > > > On Fri, Feb 6, 2009 at 11:49 PM, darrickc wrote: > >> >> I have an embedded broker in my server process and I'd like to know in my >> server process when a client subscribes to a certain topic. Through >> reading >> these forums I've figured out that using a ConsumerEventSource is the way >> to >> go. When I get an event I can figure out how many consumers there are for >> a >> topic like: >> >> public void onConsumerEvent( ConsumerEvent consumerEvt ) >> { >> numOfConsumers = consumerEvt.getConsumerCount() >> } >> >> Here is how I've setup my consumer for ConsumerEvents: >> >> >> // here topic is something like "Something.status.STOP" >> //but I've also tried "ActiveMQ.Advisory.Consumer.Topic."+topic >> destination = session.createTopic(topic); >> >> //Here the connection is the connection in the server that is used to >> publish messages on to the consumers. >> ConsumerEventSource ces = new ConsumerEventSource(connection, >> destination); >> ConsumerListener listener = new SubscriberListener(topic); >> //subscriberListener implements ConsumerListener >> ces.setConsumerListener( listener ); >> >> Am I missing something here? >> -- >> View this message in context: >> http://www.nabble.com/Can-someone-point-me-to-an-example-of-using-a-ConsumerEventSource-tp21882293p21882293.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> > > > ----- > Dejan Bosanac > > Open Source Integration - http://fusesource.com/ > ActiveMQ in Action - http://www.manning.com/snyder/ > Blog - http://www.nighttale.net > -- View this message in context: http://www.nabble.com/Can-someone-point-me-to-an-example-of-using-a-ConsumerEventSource-tp21882293p21922620.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.