[rabbitmq-discuss] Looking for clarification on acknowledgements, channels, and connections

Simone Busoli simone.busoli at gmail.com
Wed Mar 7 20:52:00 GMT 2012


Hi Alexis, I've had to deal with the same situation as Matt describes in
the past and in the end the scenarios in case of channel closure were:

   - discard messages delivered to the consumer but not yet dispatched to
   the application, assuming they will be redelivered
   - dispatch them to the application and not bother acking them as acking
   wouldn't obviously succeed
   - dispatch them to the application and try acking them anyway, catching
   errors that inevitably will be raised due to the channel being closed

Although it's not the cleanest solution I've chosen the third one (assuming
a sensible prefect-count value, as swallowing lots of ack errors would
likely affect the application performance) for a couple of reasons - quite
dependent on the context btw:

   - I wanted my application to see the messages the consumer had received
   as soon as possible, without waiting for them to be eventually redelivered
   - Not treating the scenario in which messages are acked on a closed
   channel as a special case helped keep simplicity
   - You have to deal with deduplication anyway compared to option 1 above
   (which may create the false assumption that you wouldn't have to do so in
   that case)

Simone

On Wed, Mar 7, 2012 at 21:25, Alexis Richardson <alexis at rabbitmq.com> wrote:

> Matt
>
> Could you achieve what you want by lifting 'ack' to the application layer?
>
> alexis
>
>
> On Wed, Mar 7, 2012 at 8:20 PM, Simone Busoli <simone.busoli at gmail.com>
> wrote:
> > Hi Matt, your understanding is correct, acknowledgements are meaningful
> only
> > within the context of the same channel, therefore the answer to your last
> > question is no.
> > If the connection bounces or the channel closes for any other reasons you
> > should not acknowledge the messages your consumer was delivered already
> and
> > just assume they will be redelivered to the next consumer which will
> start
> > consuming to the same queue.
> >
> > On Wed, Mar 7, 2012 at 21:00, Matt Pietrek <mpietrek at skytap.com> wrote:
> >>
> >> I thought I understood this topic clearly, but some recent experiences
> >> have me seeking more info, as I can't find this exact topic explicitly
> >> described.
> >>
> >> When a message is delivered on a particular connection/channel
> >> combination, can it ever be successfully acknowledged on a different
> >> connection?
> >>
> >> My current understanding is "no".
> >>
> >> Some background: In our messaging layer, we want to hide the connection
> >> drops from the upper application layer. That is, if we try to use a
> >> previously working connection/channel, and it fails, we'll simply catch
> the
> >> exception and try to reconnect.
> >>
> >> So the question is, after the reconnect, should we even attempt to
> >> acknowledge messages read from the original connection?
> >>
> >>
> >>
> >> _______________________________________________
> >> rabbitmq-discuss mailing list
> >> rabbitmq-discuss at lists.rabbitmq.com
> >> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> >>
> >
> >
> > _______________________________________________
> > rabbitmq-discuss mailing list
> > rabbitmq-discuss at lists.rabbitmq.com
> > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120307/dc05f826/attachment.htm>


More information about the rabbitmq-discuss mailing list