activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Detect consumers?
Date Thu, 08 May 2008 14:35:35 GMT
2008/5/8 beaker <beaker222@freenet.de>:
>
>  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...
http://activemq.apache.org/advisory-message.html

e.g. try using the ConsumerEventSource helper class...
http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/advisory/ConsumerEventSource.html

>  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
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Mime
View raw message