What happens to messages in durable queues which have already been _read_ but which have not yet been _acked_ when:

1. rabbit is shutdown gracefully?
2. the consumer channel closes abruptly -- say from crash, kill, or forced shutdown?

The rabbitmq documentation gives me the impression that I can read messages from a durable queue and choose not to ack them until I want -- perhaps hours later. Obviously, I have to watch my queue sizes in this situation. But what happens if the application never acks the messages before it terminates? What will happen when the rabbitmq-server is restarted or when or the program is restarted, will it get the messages again?

Suppose I have multiple consumers reading from the same durable queue in a round robin fashion (read ahead is 1) and one consumer has read but not acked 10 messages. If it dies, or at least closes the connection abruptly, will those 10 messages be sent to the other consumers to read?

Thanks,
Lowell

Search Discussions

  • Michael Klishin at Jul 22, 2011 at 4:20 pm
    2011/7/22 <Lowell.Boggs at emc.com>
    2. the consumer channel closes abruptly -- say from crash, kill, or forced
    shutdown?

    In this case unacknowledged messages will be returned to the queue.
  • Lowell Boggs at Jul 22, 2011 at 4:26 pm
    Delivery tags are uint64_t data.

    Is zero a valid delivery tag? Is (uint64_t)(-1)?

    I'm interested in knowing whether I need to keep extra bools laying around to keep track of the "has been auto-acked" or not flag.

    Thanks,
    Lowell
  • David Wragg at Jul 26, 2011 at 3:48 pm
    Hi Lowell,
    <Lowell.Boggs at emc.com> writes:
    Delivery tags are uint64_t data.

    Is zero a valid delivery tag? Is (uint64_t)(-1)?

    I'm interested in knowing whether I need to keep extra bools laying
    around to keep track of the "has been auto-acked" or not flag.
  • Lowell Boggs at Jul 26, 2011 at 4:09 pm
    Great! I really don't like making assumptions about data ranges without documentation.

    I'll see if I can find the spec on the web for answers to similar questions in the future.

    Thanks!

    Lowell

    -----Original Message-----
    From: David Wragg [mailto:david at rabbitmq.com]
    Sent: Tuesday, July 26, 2011 10:49 AM
    To: Boggs Jr., Lowell
    Cc: rabbitmq-discuss at lists.rabbitmq.com
    Subject: Re: [rabbitmq-discuss] Are there any unused delivery tag values?

    Hi Lowell,
    <Lowell.Boggs at emc.com> writes:
    Delivery tags are uint64_t data.

    Is zero a valid delivery tag? Is (uint64_t)(-1)?

    I'm interested in knowing whether I need to keep extra bools laying
    around to keep track of the "has been auto-acked" or not flag.
  • Matthew Sackman at Jul 22, 2011 at 4:31 pm

    On Fri, Jul 22, 2011 at 12:10:13PM -0400, Lowell.Boggs at emc.com wrote:
    What happens to messages in durable queues which have already been _read_ but which have not yet been _acked_ when:

    1. rabbit is shutdown gracefully?
    They are requeued to the back of the queue.
    2. the consumer channel closes abruptly -- say from crash, kill, or forced shutdown?
    They are requeued to the back of the queue.

    This is only relevant for persistent messages - transient messages will
    be lost if rabbit dies in any way.

    The one exception to the requeuing at the back rule is if rabbit is hard
    killed. There's a possibility that the fact that the message has been
    delivered to a consumer has not been successfully recorded on disk. As
    such, on recovery, the message may reappear at the front of the queue,
    rather than the back.
    The rabbitmq documentation gives me the impression that I can read
    messages from a durable queue and choose not to ack them until I want
    -- perhaps hours later. Obviously, I have to watch my queue sizes in
    this situation. But what happens if the application never acks the
    messages before it terminates? What will happen when the
    rabbitmq-server is restarted or when or the program is restarted, will
    it get the messages again?
    They are requeued to the back of the queue.
    Suppose I have multiple consumers reading from the same durable queue
    in a round robin fashion (read ahead is 1) and one consumer has read
    but not acked 10 messages.
    Not possible. If qos prefetch is 1 then that consumer will be sent at
    most 1 message at a time and will then receive no more until it acks
    that message.
    If it dies, or at least closes the
    connection abruptly, will those 10 messages be sent to the other
    consumers to read?
    Yes.

    Matthew

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedJul 22, '11 at 4:10p
activeJul 26, '11 at 4:09p
posts6
users4
websiterabbitmq.com
irc#rabbitmq

People

Translate

site design / logo © 2022 Grokbase