Over a million developers have joined DZone.

RabbitMQ: Pushing Messages to the Back of the Queue on NAck

Is iPaaS solving the right problems? Not knowing the fundamental difference between iPaaS and dPaaS could cost you down the road. Brought to you in partnership with Liaison Technologies.

Some useful discussion on the RabbitMQ mailing list looked at a way to push messages to the back of a queue upon negative acknowledgement.  Here was the scenario:

> Scenario:
> I'm processing messages from a queue with confirmation required.
> The number of messages relative to the consumption rate can be quite
> high at times. In excess of hundreds of thousands of messages, with
> consumption rate in the low hundreds per second range.
>> Sometimes we have to abandon processing a message for some transient
> reason (eg: external resource is locked/unavailable), and so we send a
> NAck.
> At the moment, RabbitMQ will immediately redeliver that message to any
> of the consumers. If the transient condition is still in place, we can
> potentially get into a tight loop where we're constantly consuming the
> same message(s) hundreds of times per second.
>> For our scenario, we *can* duplicate the message, send it to the
> exchange/queue, and Ack the original.


The advice on this email has some good suggestions for how to prevent getting into a tight loop.


Discover the unprecedented possibilities and challenges, created by today’s fast paced data climate and why your current integration solution is not enough, brought to you in partnership with Liaison Technologies.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}