Skip to content

Instantly share code, notes, and snippets.

@renatosousafilho
Created July 7, 2017 18:08
Show Gist options
  • Save renatosousafilho/32cc74a1769da4e0d87b4c66080cc929 to your computer and use it in GitHub Desktop.
Save renatosousafilho/32cc74a1769da4e0d87b4c66080cc929 to your computer and use it in GitHub Desktop.
client amqp for betradar
require 'bunny'
STDOUT.sync = true
conn = Bunny.new(
host: 'mq.betradar.com',
vhost: '/unifiedfeed/XXXXX',
port: 5671,
user: 'XXXXXXXXXXXXXXXXX',
password: "",
ssl: true,
verify_peer: false,
verify_peer_name: false,
allow_self_signed: true
)
conn.start
puts conn.exchange_exists?("unifiedfeed")
ch = conn.create_channel
queue = ch.queue("", exclusive: true)
queue = ch.queue("", exclusive: true)
exchange = ch.direct("unifiedfeed")
queue.bind(exchange)
q.subscribe do |delivery_info, metadata, payload|
puts "Received #{payload}"
end
sleep 1.0
conn.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment