Class: Tackle::Consumer::DeadQueue

Inherits:
Queue
  • Object
show all
Defined in:
lib/tackle/consumer/dead_queue.rb

Instance Attribute Summary

Attributes inherited from Queue

#name

Instance Method Summary collapse

Methods inherited from Queue

#create_amqp_queue

Constructor Details

#initialize(exchange, connection, logger) ⇒ DeadQueue

Returns a new instance of DeadQueue.



5
6
7
8
9
10
11
# File 'lib/tackle/consumer/dead_queue.rb', line 5

def initialize(exchange, connection, logger)
  name = "#{exchange.name}.dead"

  options = { :durable => true }

  super(name, options, connection, logger)
end

Instance Method Details

#publish(message) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/tackle/consumer/dead_queue.rb', line 13

def publish(message)
  message.log_error "Pushing message to '#{name}'"

  @amqp_queue.publish(message.payload)

  message.log_error "Message pushed to '#{name}'"
rescue StandardError => ex
  message.log_error "Error while pushing message exception='#{ex}'"

  raise ex
end