Implementing non-blocking retry with backoff with spring-amqp and rabbitmq

621 views
Skip to first unread message

alam86

unread,
Sep 17, 2015, 2:12:07 PM9/17/15
to rabbitmq-users

I am looking for a good way to implement retries with a backoff policy using spring amqp and Rabbit MQ, but the requirement is that the listener should not be blocked (so it is free to process other messages). I see a similar question asked/answered on StackOverflow but it does not include the solution for 'backing off':

RabbitMQ & Spring amqp retry without blocking consumers

The questions I have are:

  1. Does the default spring-retry implementation block threads while retrying? The implementation in github indicates that it does.

  2. If the assumption above is true, is the only way to do this implementing a separate queue for retries (DLQ?), and setting a TTL for each message (assuming we don't want to block threads for the backoff interval).

  3. If we go with the approach above (DLQ or a separate queue), won't we need separate queues for each retry attempt? If we use just 1 queue for retries, the same queue will contain messages with a TTL ranging from minimum retry interval to maximum retry interval, and if the message at the front of the queue has the max TTL, the message behind it will not be picked up even if it has min TTL. This is per the Rabbit MQ TTL documentation here (see Caveats):

  4. Is there another way to implement a non-blocking Backoff Retry mechanism?

Michael Klishin

unread,
Sep 17, 2015, 4:11:07 PM9/17/15
to rabbitm...@googlegroups.com
Spring AMQP questions belong to Stack Overflow, tagged with spring-amqp. This list only covers RabbitMQ Java client.
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

alam86

unread,
Sep 17, 2015, 4:42:44 PM9/17/15
to rabbitmq-users
Thanks Michael! This has been posted there as well.
Reply all
Reply to author
Forward
0 new messages