Skip to content

Instantly share code, notes, and snippets.

@rattrap
Created February 20, 2018 16:28
Show Gist options
  • Save rattrap/a8d5f9c2bfc8a448b9932029a38ec37f to your computer and use it in GitHub Desktop.
Save rattrap/a8d5f9c2bfc8a448b9932029a38ec37f to your computer and use it in GitHub Desktop.
require "bunny"
# Start a communication session with RabbitMQ
conn = Bunny.new("amqp://username:password@rabbit-server:5672/%2F")
conn.start
# open a channel
ch = conn.create_channel
# declare a queue
q = ch.queue("test", durable:true)
while true do
q.publish("test")
end
# close the connection
conn.stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment