Class: Pwwka::ErrorHandlers::NackAndRequeueOnce

Inherits:
BaseErrorHandler show all
Defined in:
lib/pwwka/error_handlers/nack_and_requeue_once.rb

Constant Summary

Constants included from Logging

Logging::LEVELS

Instance Method Summary collapse

Methods included from Logging

#logf, #logger

Instance Method Details

#handle_error(receiver, queue_name, payload, delivery_info, exception) ⇒ Object


5
6
7
8
9
10
11
12
13
14
# File 'lib/pwwka/error_handlers/nack_and_requeue_once.rb', line 5

def handle_error(receiver,queue_name,payload,delivery_info,exception)
  if delivery_info.redelivered
    log("Error Processing Message",queue_name,payload,delivery_info,exception)
    receiver.nack(delivery_info.delivery_tag)
  else
    log("Retrying an Error Processing Message",queue_name,payload,delivery_info,exception)
    receiver.nack_requeue(delivery_info.delivery_tag)
  end
  keep_going
end