A modified retry handler for RabbitMQ and Sneakers
A small modification of Sneaker's built-in Maxretry class
the replacement class is called SneakersRetry::Handlers::Maxretry2
has the exact same logic, except that when a message fails all retries, this
handler stores the final failure (the message) in same format as the original message,
allowing you to use RabbitMQ's shovel plugin
to manually re-enqueue the messages who failed all retries
Something that is sometimes needed in production systems
Include it in your Gemfile.
$ cat Gemfile
...
gem 'sneakers-retry'
...
Next install it with Bundler.
$ bundle install
read documentation for Sneakers initialize your worker with the Maxretry2 handler:
class MyWorker
...
from_queue 'audit_service', {
handler: SneakersRetry::Handlers::Maxretry2,
...
}
...
end