Created
February 20, 2018 16:28
-
-
Save rattrap/a8d5f9c2bfc8a448b9932029a38ec37f to your computer and use it in GitHub Desktop.
This file contains hidden or 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" | |
# 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