Created
January 11, 2013 17:04
-
-
Save celldee/4512337 to your computer and use it in GitHub Desktop.
Publisher confirms publisher for testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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