Skip to content

Instantly share code, notes, and snippets.

@c2h2
Created May 14, 2012 09:42
Show Gist options
  • Save c2h2/2692974 to your computer and use it in GitHub Desktop.
Save c2h2/2692974 to your computer and use it in GitHub Desktop.
bunny test, receiver file
require 'bunny'
EXCH = "asdf"
QUE = "qwer"
b= Bunny.new
b.start
exch = b.exchange(EXCH, :type => :fanout)
queue = b.queue(QUE)
queue.bind(exch)
queue.subscribe(:consumer_tag=>"sometag") do |msg|
puts queue.message_count
puts msg[:payload]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment