activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From YoungSoul <>
Subject Re: How to Pause/Resume a MessageListener?
Date Mon, 15 Jan 2007 21:36:34 GMT

I had a similar requirement, but decided to use the synchronous receive
(timeout) method and basically check to see if I were paused or resumed.  I
know polling is generally not a good idea.  I also considered a pause
message - but then how would one resume?  

For my requirement it was not important to pause immediately so my timeout
could be pretty high and I would actually only timeout when I had nothing to
do so spending cycles on checking did not seem to get in the way of real
processing.  Everytime I received a message I would just make an additional
check to see if I were paused before I went back to the receive(timeout)

I would be interested in seeing how you did it with the listener.


nlif wrote:
> Since there have been no replies, let me try to elaborate a little about
> our issue:
> We run in a cluster, and all nodes use Jencks to pull messages from the
> AMQ broker. For various reasons, we may need to "disable" specific nodes
> from time to time, and then "enable" them later. While a node is disabled,
> we don't want it to pull messages from the broker. However, a disabled
> node is not a crashed node: it may very well be up and running; just NOT
> pulling messages. Therefore, what we need is a way to "pause" the Jencks
> connectors, so that they don't pull messages (and, of course, to "resume"
> them later, when the node wishes to process messages again).
> Does anybody have any ideas on how to implement this? Is there such a
> built-in feature in ActiveMQ or Jencks? We'd hate to develop a mechanism
> just to find out later, that there is a way to it...
> Thanks in advance,
> Naaman

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

View raw message