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 <darricks...@gmail.com> 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. > >