activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jahvid.Williams" <>
Subject Re: Pausing a consumer
Date Wed, 14 Jan 2009 20:50:44 GMT

brianbaquiran wrote:
> Hello,
> Is there a way to temporarily pause or throttle messages received by a
> consumer using a messageListener?
As far as i have found in the on_message method for your MessageListener
class you could attempt to slow down the message consumption process,
possibly with a time.sleep(x amt of time).

brianbaquiran wrote:
> So now I'm looking for a way to turn off the MessageListener when the
> number of unacknowledged messages reaches the maximum number allowed, and
> turn on the MessageListener as soon as I receive an ack from the server.
> Is there a correct way to do this?

Im not sure about turning acknowledgments off, but if you wanted to filter
how many messages that can be sent over to your server at a time why not
send a batch of messages over in a queue/list. 
 So lets say the server is capable of handling 1000 messages a minute, why
not have a queue/list that stores 500 messages per transfer and dispatch
them to the server (bear in mind given the size of the messages this could
end up using extra bandwidth). 

“A foolish man tells a woman to stop talking, but a wise man tells her that
her mouth is extremely beautiful when her lips are closed”
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message