Created
July 7, 2017 18:08
-
-
Save renatosousafilho/32cc74a1769da4e0d87b4c66080cc929 to your computer and use it in GitHub Desktop.
client amqp for betradar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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