Skip to content

Instantly share code, notes, and snippets.

@dan-palmer
Last active August 29, 2015 14:23
Show Gist options
  • Save dan-palmer/d802fdf45f1d48fba27d to your computer and use it in GitHub Desktop.
Save dan-palmer/d802fdf45f1d48fba27d to your computer and use it in GitHub Desktop.
Testing a connection to Rabbit MQ
session = Bunny.new(
Sneakers::CONFIG[:amqp],
heartbeat: Sneakers::CONFIG[:heartbeat],
vhost: Sneakers::CONFIG[:vhost])
session.connected? # => false
session.start # connects to rabbit
session.connected? # => true
session.close # closes the connection
session.connected? # => false
# Sneakers is just a wrapper around the Bunny library so this should be ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment