activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin C." <>
Subject Re: Dispatch Policy
Date Wed, 27 Jul 2011 03:25:37 GMT

The only issue with Spring's DefaultMessageListenerContainer we have
encountered with prefetch 0 was that the stop() method caused threads
to keep hanging in the DefaultMessageListenerContainer on shutdown,
because the receive(timeout) call of ActiveMQ uses a non-timed-out
read to the broker in this case (i.e. it delegates the timeout to the
broker) for a MessagePull it will never receive as the connection is
stopped. If you are using DefaultMessageListenerContainer, maybe you
can sub-class it and re-implement stop() in a way to wait for all
polling threads to exit before calling connection.stop().

Best regards,

On Tue, Jul 26, 2011 at 11:15 PM, yousafsajjad <> wrote:
> I am not sure whether this will work or not.
> I want consumers to poll for messages instead of broker pushing them to
> different consumers in a round robin fashion. I am not able to set prefetch
> limit equal 0 before of Spring framework.
> Any ideas that might help asynchronous consumers to poll for messages
> without setting prefetch limit to 0?
> --
> View this message in context:
> Sent from the ActiveMQ - User mailing list archive at

View raw message