Class: Chef::Deployment::Monitor::RmqSink
- Defined in:
- lib/chef_deployment_monitor/sinks.rb
Instance Method Summary collapse
-
#initialize ⇒ RmqSink
constructor
A new instance of RmqSink.
- #receive(data) ⇒ Object
Constructor Details
#initialize ⇒ RmqSink
Returns a new instance of RmqSink.
12 13 14 15 16 17 18 |
# File 'lib/chef_deployment_monitor/sinks.rb', line 12 def initialize @conn = Bunny.new(hostname: Monitor::Config[:mq_server]) @conn.start @ch = @conn.create_channel @q = @ch.queue(Monitor::Config[:mq_queue], durable: true) end |
Instance Method Details
#receive(data) ⇒ Object
20 21 22 |
# File 'lib/chef_deployment_monitor/sinks.rb', line 20 def receive(data) @q.publish(data, persistent: true, content_type: 'application/json') end |