Skip to content

Instantly share code, notes, and snippets.

@patrikjohansson
Created January 20, 2012 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrikjohansson/1647101 to your computer and use it in GitHub Desktop.
Save patrikjohansson/1647101 to your computer and use it in GitHub Desktop.
require "rubygems"
require "bunny"
require "pp"
bunny = Bunny.new(:host => "127.0.0.1", :port => 15672)
bunny.start
pp bunny.status
# Send message
exchange = bunny.exchange("test", { :type => :fanout, :durable => true })
msg = Marshal.dump({:id => 1, :msg => "foo!"})
s = exchange.publish(msg, {:persistent => true })
pp s
queue = bunny.queue("test", {:durable => true})
pp queue.status
bunny.stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment