Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Example 1 for "Messaging for Rubyists"

View example1.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
require 'bunny'
 
# connecting to a broker
b = Bunny.new({}, {:spec => "09"})
b.start
 
# setup
e = b.exchange("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]}"
 
b.stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.