Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 34951 invoked from network); 9 Feb 2009 12:02:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2009 12:02:21 -0000 Received: (qmail 36773 invoked by uid 500); 9 Feb 2009 12:02:20 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 36748 invoked by uid 500); 9 Feb 2009 12:02:20 -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 36737 invoked by uid 99); 9 Feb 2009 12:02:20 -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 04:02:20 -0800 X-ASF-Spam-Status: No, hits=2.4 required=10.0 tests=HTML_MESSAGE,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chubrilo@gmail.com designates 209.85.220.20 as permitted sender) Received: from [209.85.220.20] (HELO mail-fx0-f20.google.com) (209.85.220.20) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 12:02:12 +0000 Received: by fxm13 with SMTP id 13so2839741fxm.14 for ; Mon, 09 Feb 2009 04:01:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=Qp1UjcNMEeiVQWv+x0CXzhZy8tAhPt/gFZBRJtfjjf4=; b=ldDQPNKNHc52WB0Mfys/UyeMYZ3F+L4Qcz7whRLFjRT9rgeQAoCkyINxvm32ev1fQE YeWa3Fmaurd4HKtabmka9d+p9nT2cT2PtgrCJGGHd+bdUbmC+Bov9CF4VP8Ja8jSvYC6 BrwmpPUkVvwtNmEdtMUI9EcNCChZzJhxx6Quo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=WrjzyyauXhhOF/Z0dBD0YGQ3A8odiO5W4GNu0ScZqSj07YjD1bRSiAQAB5dYZaRNWn NztQIECsB6oKyLZAJGY0k/VYRdSqCpgBV8XQlIDkGVpihLjVBaQYNM9YeJKNrH/0dvBD ZFX2vef9vWr35SRyGeD6IIMjDToEYbrN3RiUw= MIME-Version: 1.0 Sender: chubrilo@gmail.com Received: by 10.103.173.15 with SMTP id a15mr2071746mup.59.1234180909597; Mon, 09 Feb 2009 04:01:49 -0800 (PST) In-Reply-To: <21882293.post@talk.nabble.com> References: <21882293.post@talk.nabble.com> Date: Mon, 9 Feb 2009 13:01:49 +0100 X-Google-Sender-Auth: bbb6199af9ade729 Message-ID: <36e91d9d0902090401q3c7d0566lcebf6de99d59c4e0@mail.gmail.com> Subject: Re: Can someone point me to an example of using a ConsumerEventSource From: Dejan Bosanac To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=001636417647b482bc04627b2259 X-Virus-Checked: Checked by ClamAV on apache.org --001636417647b482bc04627b2259 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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. > > --001636417647b482bc04627b2259--