Class: Ros::Console::Commands::RabbitMQ
- Inherits:
-
Pry::ClassCommand
- Object
- Pry::ClassCommand
- Ros::Console::Commands::RabbitMQ
- Defined in:
- lib/ros/core/console.rb
Instance Method Summary collapse
-
#process ⇒ Object
TODO: refactor.
Instance Method Details
#process ⇒ Object
TODO: refactor
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/ros/core/console.rb', line 110 def process return unless ENV['AMQP_URL'] record = { bucket: 'test', key: 'path/to/object' } conn = Bunny.new(ENV['AMQP_URL']) conn.start ch = conn.create_channel puts "#{record[:bucket]}/#{record[:key]}" puts ENV['AMQP_QUEUE_NAME'] puts record.merge!({ tenant: 'hsbc', environment: 'development' }) res = ch.default_exchange.publish("#{record[:bucket]}/#{record[:key]}", routing_key: ENV['AMQP_QUEUE_NAME'], headers: record.merge({ version: ENV['AMQP_VERSION'].to_s })) puts 'Here is output from bunny' puts res conn.close end |