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)
method.

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

Thanks




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: 
http://www.nabble.com/How-to-Pause-Resume-a-MessageListener--tf2902158.html#a8379791
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to