Skip to content

Instantly share code, notes, and snippets.

@mhorbul
Created September 17, 2009 21:37
Show Gist options
  • Save mhorbul/188739 to your computer and use it in GitHub Desktop.
Save mhorbul/188739 to your computer and use it in GitHub Desktop.
require 'mq'
[
{:host => "localhost", :port => "5671"},
{:host => "localhost", :port => "5672"}
].each do |options|
begin
puts options.inspect
@conn = AMQP.start(options) do
puts "connected"
end
rescue => e
AMQP.instance_variable_set('@conn', nil)
next
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment