Method: Ears::Middlewares::MaxRetries#initialize

Defined in:
lib/ears/middlewares/max_retries.rb

#initialize(opts) ⇒ MaxRetries

Returns a new instance of MaxRetries.

Parameters:

  • opts (Hash)

    The options for the middleware.

Options Hash (opts):

  • :retries (Integer)

    The number of retries before the message is sent to the error queue.

  • :error_queue (String)

    The name of the queue where messages should be sent to when the max retries are reached.



10
11
12
13
14
# File 'lib/ears/middlewares/max_retries.rb', line 10

def initialize(opts)
  super()
  @retries = opts.fetch(:retries)
  @error_queue = opts.fetch(:error_queue)
end