FAQ
Using RabbitMQ together with the Carrot Python bindings.

Two questions:

- - assuming a consumer could process a message with success - what is
the difference in the message handling inside the queue between
acknowledging it or discarding it - it will be removed from the queue
in both cases?!

- - assuming a consumer could not process a message properly (e.g. some
database backend down) and is interested to re-try this message later.
In this case I would requeue the message. At which position in the
queue will the message be inserted? At the end of the queue?

Andreas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lists.vcf
Type: text/x-vcard
Size: 316 bytes
Desc: not available
Url : http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100505/41b1bb9b/attachment.vcf

Search Discussions

  • Matthew Sackman at May 5, 2010 at 7:03 pm

    On Wed, May 05, 2010 at 07:51:35PM +0200, Andreas Jung wrote:
    Two questions:

    - - assuming a consumer could process a message with success - what is
    the difference in the message handling inside the queue between
    acknowledging it or discarding it - it will be removed from the queue
    in both cases?!
    If you don't ack it, it will be retained by RabbitMQ and will be
    redelivered to some other consumer eventually when your current
    consumer cancels/dies.
    - - assuming a consumer could not process a message properly (e.g. some
    database backend down) and is interested to re-try this message later.
    In this case I would requeue the message. At which position in the
    queue will the message be inserted? At the end of the queue?
    Basic.reject is not implemented. Calling basic.recover{requeue=true}
    will requeue all non-acknowledged messages outstanding on the current
    *channel*. Note this is not queue specific.

    The specification is silent as to where in the queues the messages
    should be reentered and you should not rely on any particular behaviour.
    Currently RabbitMQ requeues messages at the end of the queue (i.e. they
    behave like new publishes), but that can change.

    Matthew
  • Andreas Jung at May 6, 2010 at 5:09 am

    Matthew Sackman wrote:
    On Wed, May 05, 2010 at 07:51:35PM +0200, Andreas Jung wrote:
    Two questions:

    - - assuming a consumer could process a message with success - what is
    the difference in the message handling inside the queue between
    acknowledging it or discarding it - it will be removed from the queue
    in both cases?!
    If you don't ack it, it will be retained by RabbitMQ and will be
    redelivered to some other consumer eventually when your current
    consumer cancels/dies.

    Got it. Since the consumer is called through a call-back it will get the
    same message again (after restarting and if it is the only consumer) if
    the consumer dies without ack-ing the message.

    Andreas
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: lists.vcf
    Type: text/x-vcard
    Size: 316 bytes
    Desc: not available
    Url : http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100506/be787a40/attachment-0001.vcf
  • Matthias Radestock at May 6, 2010 at 5:17 am

    Matthew Sackman wrote:
    On Wed, May 05, 2010 at 07:51:35PM +0200, Andreas Jung wrote:
    Two questions:

    - - assuming a consumer could process a message with success - what is
    the difference in the message handling inside the queue between
    acknowledging it or discarding it - it will be removed from the queue
    in both cases?!
    If you don't ack it, it will be retained by RabbitMQ and will be
    redelivered to some other consumer eventually when your current
    consumer cancels/dies.
    Careful here - cancelling a consumer with basic.cancel does *not* cause
    unack'ed messages to be requeued/redelivered. For that to happen the
    channel needs to be closed (explicitly, or implicitly via a connection
    closure or termination).


    Matthias.
  • Andreas Jung at May 6, 2010 at 5:28 am

    Matthias Radestock wrote:
    Matthew Sackman wrote:
    On Wed, May 05, 2010 at 07:51:35PM +0200, Andreas Jung wrote:
    Two questions:

    - - assuming a consumer could process a message with success - what is
    the difference in the message handling inside the queue between
    acknowledging it or discarding it - it will be removed from the queue
    in both cases?!
    If you don't ack it, it will be retained by RabbitMQ and will be
    redelivered to some other consumer eventually when your current
    consumer cancels/dies.
    Careful here - cancelling a consumer with basic.cancel does *not* cause
    unack'ed messages to be requeued/redelivered. For that to happen the
    channel needs to be closed (explicitly, or implicitly via a connection
    closure or termination).
    Fair enough. Using Python you would ensure that the related code is
    properly enclosed within a context manager. For the case the consumer
    dies for whatever reasons: the channel would be closed and the action
    taken by the queue as you described it.

    Andreas
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: lists.vcf
    Type: text/x-vcard
    Size: 316 bytes
    Desc: not available
    Url : http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100506/5a37d3d6/attachment.vcf

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedMay 5, '10 at 5:51p
activeMay 6, '10 at 5:28a
posts5
users3
websiterabbitmq.com
irc#rabbitmq

People

Translate

site design / logo © 2022 Grokbase