Skip to content

Instantly share code, notes, and snippets.

@celldee
Created January 11, 2013 17:04
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 celldee/4512337 to your computer and use it in GitHub Desktop.
Save celldee/4512337 to your computer and use it in GitHub Desktop.
Publisher confirms publisher for testing
require 'bunny'
conn = Bunny.new
conn.start
ch = conn.create_channel
x = ch.direct('hello-exchange', :durable => true)
q = ch.queue('hello-queue', :durable => true).bind(x, :routing_key => 'hola')
msg = ARGV[0]
ch.confirm_select
100.times do |i|
x.publish("#{i}: #{msg}", :routing_key => 'hola')
end
ch.wait_for_confirms
#conn.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment