Class: RosettaQueue::Producer

Inherits:
Object
  • Object
show all
Includes:
MessageHandler
Defined in:
lib/rosetta_queue/producer.rb

Instance Attribute Summary

Attributes included from MessageHandler

#adapter_proxy

Class Method Summary collapse

Methods included from MessageHandler

#ack, #destination, #handle_message, included, #options_hash

Class Method Details

.publish(destination, message, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/rosetta_queue/producer.rb', line 6

def self.publish(destination, message, options = {})
  ExceptionHandler::handle(:publishing,
    lambda {
      {:message => Filters.safe_process_sending(message),
       :action => :publishing,
       :destination => destination,
       :options => options}
    }) do
    RosettaQueue::Adapter.open do |a|
      a.send_message(
        Destinations.lookup(destination),
        Filters.process_sending(message),
        options)
    end
  end
end