[rabbitmq-discuss] Queue Stalling
Jerry Kuch
jerryk at vmware.com
Fri Jan 21 02:05:08 GMT 2011
Hi, Abinesh...
> I am using rabbitmq-grails plugin version 0.2. Using that plugin am
> able to create queues. Also am placing messages in the queues. The
> handler classes too continuously fetching the messages and proceed
> with further processing. But, sometimes the handler classes are not
> fetching the messages properly, due to that it results the messages
> are remain in the queue for long time. Do we need to acknowledge the
> message after fetching it or else please some one tell me the reason
> why the messages are remain in the queue. Also tell me is it any other
> way to fetch the message which is remain in the queue for a long time.
This should be straightforward to take care of. An AMQP broker bears
responsibility for maintaining the existence of a message until it
knows that a client has taken responsibility for it. Thus, if a
message is delivered to your client, a copy of the message
nevertheless remains behind on the broker until such time as the
delivery is ACKed. You can do this either by explicitly using the
AMQP basic.ack method yourself, or by setting your consumer up to
auto-ACK, in which case it will ACK for you when messages are
received.
The intent of this handoff is to handle the case where your consumer
might have work to do in response to a delivered message, but where it
might crash before completing that work. If your consumer goes away
with a delivered, but un-ACKed message, the broker will then re-queue
the message and attempt to redeliver it later.
Best regards,
Jerry
More information about the rabbitmq-discuss
mailing list