activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beaker <>
Subject Re: Detect consumers?
Date Mon, 19 May 2008 06:22:34 GMT


I tried the Advisory Topics, but somehow I can not manage to get any
advisory messages...

I have tested this with a small test server I have found here:

This is a piece of code where I tried to set up a consumer for the advisory

            ActiveMQDestination topic = (ActiveMQDestination)

            Destination advisoryDestination =

            MessageConsumer consumer =

Then I tried to connect some consumers to the topic "ChatTopic", but I never
get an advisory message. Can you tell me what is wrong? Is there maybe some
kind of example or tutorial on how to do this?


James.Strachan wrote:
> 2008/5/8 beaker <>:
>>  Hello,
>>  is it possible for a producer to detect, if there are any consumers on
>> the
>>  topic/queue he is sending?
> Yes - you can use advisories...
> e.g. try using the ConsumerEventSource helper class...
>>  I want the producer to only send out messages, if there is someone
>> listening
>>  for them.
> We could maybe enhance the JMS client so that it can avoid sending
> messages to topics which have no consumers (i.e. to reduce the cost of
> marshalling the message on the wire and sending it to the broker and
> the broker consuming it).
> -- 
> James
> -------
> Open Source Integration

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message