Module: SneakersHandlers

Defined in:
lib/sneakers_handlers/retry_handler.rb,
lib/sneakers_handlers.rb,
lib/sneakers_handlers/version.rb,
lib/sneakers_handlers/dead_letter_handler.rb,
lib/sneakers_handlers/exponential_backoff_handler.rb

Overview

Using this handler, failed messages will be retried with an exponential backoff delay, for a certain number of times, until they are dead-lettered.

To use it you need to defined this handler in your worker:

from_queue “my-app.queue_name”,

exchange: "my_exchange_name",
routing_key: "my_routing_key",
handler: SneakersHandlers::ExponentialBackoffHandler,
arguments: { "x-dead-letter-exchange" => "my_exchange_name.dlx",
             "x-dead-letter-routing-key" => "my-app.queue_name" }}

By default it will retry 25 times before dead-lettering a message, but you can also customize that with the ‘max_retries` option:

from_queue “my-app.queue_name”,

exchange: "my_exchange_name",
routing_key: "my_routing_key",
max_retries: 10,
handler: SneakersHandlers::ExponentialBackoffHandler,
arguments: { "x-dead-letter-exchange" => "my_exchange_name.dlx",
             "x-dead-letter-routing-key" => "my-app.queue_name" }}

Defined Under Namespace

Classes: DeadLetterHandler, ExponentialBackoffHandler, RetryHandler

Constant Summary collapse

VERSION =
"0.0.8"