Class: Katello::Qpid::Connection::Receiver
- Inherits:
-
Qpid::Proton::MessagingHandler
- Object
- Qpid::Proton::MessagingHandler
- Katello::Qpid::Connection::Receiver
- Defined in:
- app/lib/katello/qpid/connection.rb
Instance Method Summary collapse
-
#initialize(url, connection_options, address, handler) ⇒ Receiver
constructor
A new instance of Receiver.
- #on_container_start(container) ⇒ Object
- #on_message(_delivery, message) ⇒ Object
Constructor Details
#initialize(url, connection_options, address, handler) ⇒ Receiver
Returns a new instance of Receiver.
53 54 55 56 57 58 59 60 61 |
# File 'app/lib/katello/qpid/connection.rb', line 53 def initialize(url, , address, handler) super() @url = url = .merge( idle_timeout: 30 ) @address = address @handler = handler end |
Instance Method Details
#on_container_start(container) ⇒ Object
63 64 65 66 |
# File 'app/lib/katello/qpid/connection.rb', line 63 def on_container_start(container) c = container.connect(@url, ) c.open_receiver(@address) end |
#on_message(_delivery, message) ⇒ Object
68 69 70 71 |
# File 'app/lib/katello/qpid/connection.rb', line 68 def (_delivery, ) received = Katello::Messaging::ReceivedMessage.new(body: .body) @handler.handle(received) end |