<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19088"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=632273221-22072011><FONT color=#0000ff
face=Arial>To extend my previous question, if I set the prefetch count to 10 but
there is only 1 message in the buffer, and if I read the message but do not ack
it, will I be able to read up to 9 messages later when they show up? Or is
the prefetch only applicable when the messages are actually available in the
buffer?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=632273221-22072011><FONT color=#0000ff
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=632273221-22072011><FONT color=#0000ff
face=Arial>Thanks,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=632273221-22072011><FONT color=#0000ff
face=Arial> Lowell</FONT></SPAN></DIV><BR>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Boggs Jr., Lowell <BR><B>Sent:</B>
Friday, July 22, 2011 4:28 PM<BR><B>To:</B>
rabbitmq-discuss@lists.rabbitmq.com<BR><B>Subject:</B> Reading messages
without acking them<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial>
<DIV id=body class="mb cb fontsize2 ">
<DIV id=inbdy><A name=msg_c9cc14c924840370></A><FONT class=fixed_width
face="Courier, Monospaced">
<P>
<DIV style="DISPLAY: block" id=qhide_315340 class=qt><SPAN
class=179012621-22072011><FONT face=Arial>Thanks Michael and
Matt.</FONT></SPAN></DIV>
<DIV style="DISPLAY: block" class=qt><SPAN class=179012621-22072011><FONT
face=Arial></FONT></SPAN> </DIV>
<DIV style="DISPLAY: block" class=qt><SPAN class=179012621-22072011><FONT
face=Arial>In the attached, Matt says that with a QOS/prefetch of 1, I
rabbitmq will not let me read more than one message without acking
it.</FONT></SPAN></DIV>
<DIV style="DISPLAY: block" class=qt><SPAN class=179012621-22072011><FONT
face=Arial></FONT></SPAN> </DIV>
<DIV style="DISPLAY: block" class=qt><SPAN class=179012621-22072011><FONT
face=Arial>So, is it true then that if I set the prefetch number to 10,
I can read up to 10 without acking any of them?</FONT></SPAN></DIV>
<DIV style="DISPLAY: block" class=qt><SPAN class=179012621-22072011><FONT
face=Arial></FONT></SPAN> </DIV>
<DIV style="DISPLAY: block" class=qt><SPAN class=179012621-22072011><FONT
face=Arial>Thanks,</FONT></SPAN></DIV>
<DIV style="DISPLAY: block" class=qt><SPAN class=179012621-22072011><FONT
face=Arial> Lowell</FONT></SPAN></DIV>
<DIV style="DISPLAY: block" class=qt><SPAN class=179012621-22072011><FONT
face=Arial></FONT></SPAN> </DIV>
<DIV style="DISPLAY: block" class=qt><FONT face=Arial></FONT> </DIV>
<DIV style="DISPLAY: block" class=qt>On Fri, Jul 22, 2011 at 12:10:13PM -0400,
Lowell.Bo<A
href="blocked::http://groups.google.com/groups/unlock?_done=/group/rabbitmq-discuss/browse_thread/thread/c764b1ebb8471857&msg=c9cc14c924840370"
target=_parent>...</A>@emc.com wrote: <BR>> What happens to messages in
durable queues which have already been _read_ but which have not yet been
_acked_ when: <BR>
<P>> 1. rabbit is shutdown gracefully? <BR><BR></P></DIV>They are
requeued to the back of the queue. <BR>
<P>
<DIV style="DISPLAY: block" id=qhide_315341 class=qt>> 2. the
consumer channel closes abruptly -- say from crash, kill, or forced shutdown?
<BR><BR></DIV>They are requeued to the back of the queue. <BR>
<P>This is only relevant for persistent messages - transient messages will
<BR>be lost if rabbit dies in any way. <BR>
<P>The one exception to the requeuing at the back rule is if rabbit is hard
<BR>killed. There's a possibility that the fact that the message has been
<BR>delivered to a consumer has not been successfully recorded on disk. As
<BR>such, on recovery, the message may reappear at the front of the queue,
<BR>rather than the back. <BR>
<P>
<DIV style="DISPLAY: block" id=qhide_315342 class=qt>> The rabbitmq
documentation gives me the impression that I can read <BR>> messages from a
durable queue and choose not to ack them until I want <BR>> --
perhaps hours later. Obviously, I have to watch my queue sizes in
<BR>> this situation. But what happens if the application never acks
the <BR>> messages before it terminates? What will happen when the
<BR>> rabbitmq-server is restarted or when or the program is restarted,
will <BR>> it get the messages again? <BR><BR></DIV>They are requeued to
the back of the queue. <BR>
<P>
<DIV style="DISPLAY: block" id=qhide_315343 class=qt>> Suppose I have
multiple consumers reading from the same durable queue <BR>> in a round
robin fashion (read ahead is 1) and one consumer has read <BR>> but not
acked 10 messages. <BR><BR></DIV>Not possible. If qos prefetch is 1 then that
consumer will be sent at <BR>most 1 message at a time and will then receive no
more until it acks <BR>that message. <BR>
<P>
<DIV style="DISPLAY: block" id=qhide_315344 class=qt>> If it dies, or
at least closes the <BR>> connection abruptly, will those 10 messages be
sent to the other <BR>> consumers to read? <BR><BR></DIV>Yes. <BR>
<P>Matthew <BR></P></FONT></DIV></DIV></FONT></DIV></BLOCKQUOTE></BODY></HTML>