Class: BBK::AMQP::RejectionPolicies::Reject
- Inherits:
-
Object
- Object
- BBK::AMQP::RejectionPolicies::Reject
- Defined in:
- lib/bbk/amqp/rejection_policies/reject.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #call(message, error) ⇒ Object
-
#initialize(logger: BBK::Utils::Logger.default) ⇒ Reject
constructor
A new instance of Reject.
Constructor Details
#initialize(logger: BBK::Utils::Logger.default) ⇒ Reject
Returns a new instance of Reject.
8 9 10 |
# File 'lib/bbk/amqp/rejection_policies/reject.rb', line 8 def initialize(logger: BBK::Utils::Logger.default) @logger = logger end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'lib/bbk/amqp/rejection_policies/reject.rb', line 6 def logger @logger end |
Instance Method Details
#call(message, error) ⇒ Object
12 13 14 15 |
# File 'lib/bbk/amqp/rejection_policies/reject.rb', line 12 def call(, error) logger.debug "Reject message #{message.headers[:type]}[#{message.headers[:message_id]}] delivery tag: #{message.delivery_info[:delivery_tag].to_i}. Error: #{error.inspect}" .delivery_info[:channel].reject .delivery_info[:delivery_tag], false end |