Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Example 1 for "Messaging for Rubyists"
require 'bunny'
# connecting to a broker
b ={}, {:spec => "09"})
# setup
e ="exchange-01")
q = b.queue("queue-01")
q.bind e
# producer
e.publish("Message Body")
# consumer
msg = q.pop
puts "This is the message: #{msg}"
puts "This is the payload: #{msg[:payload]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment