Sha256: 50fb5618de80cf6c00262f37c79fecf1396185e1912212c5debd72ffc4b8226f

Contents?: true

Size: 538 Bytes

Versions: 124

Compression:

Stored size: 538 Bytes

Contents

#!/usr/bin/env ruby
# encoding: utf-8

require "rubygems"
require "bunny"

puts "=> Demonstrating publisher confirms"
puts

conn = Bunny.new
conn.start

ch   = conn.create_channel
x    = ch.fanout("amq.fanout")
q    = ch.queue("", :exclusive => true).bind(x)

ch.confirm_select
1000.times do
  x.publish("")
end
ch.wait_for_confirms # blocks calling thread until all acks are received

sleep 0.2
puts "Received acks for all published messages. #{q.name} now has #{q.message_count} messages."

sleep 0.7
puts "Disconnecting..."
conn.close

Version data entries

124 entries across 124 versions & 1 rubygems

Version Path
bunny-1.3.1 examples/guides/extensions/publisher_confirms.rb
bunny-1.3.0 examples/guides/extensions/publisher_confirms.rb
bunny-1.2.2 examples/guides/extensions/publisher_confirms.rb
bunny-1.2.1 examples/guides/extensions/publisher_confirms.rb
bunny-1.2.0 examples/guides/extensions/publisher_confirms.rb
bunny-1.1.9 examples/guides/extensions/publisher_confirms.rb
bunny-1.1.8 examples/guides/extensions/publisher_confirms.rb
bunny-1.1.7 examples/guides/extensions/publisher_confirms.rb
bunny-1.1.6 examples/guides/extensions/publisher_confirms.rb
bunny-1.1.5 examples/guides/extensions/publisher_confirms.rb
bunny-1.1.4 examples/guides/extensions/publisher_confirms.rb
bunny-1.1.3 examples/guides/extensions/publisher_confirms.rb
bunny-1.1.2 examples/guides/extensions/publisher_confirms.rb
bunny-1.1.1 examples/guides/extensions/publisher_confirms.rb
bunny-1.1.0 examples/guides/extensions/publisher_confirms.rb
bunny-1.1.0.rc1 examples/guides/extensions/publisher_confirms.rb
bunny-1.0.7 examples/guides/extensions/publisher_confirms.rb
bunny-1.0.6 examples/guides/extensions/publisher_confirms.rb
bunny-1.0.5 examples/guides/extensions/publisher_confirms.rb
bunny-1.1.0.pre2 examples/guides/extensions/publisher_confirms.rb