Sha256: a317fb39a8b28ecc0db5921df6f58ac44c9c032e4d416111f49f4d00ad9870fe

Contents?: true

Size: 594 Bytes

Versions: 25

Compression:

Stored size: 594 Bytes

Contents

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

require "bundler"
Bundler.setup

$:.unshift(File.expand_path("../../../lib", __FILE__))

require 'bunny'

conn = Bunny.new(:heartbeat_interval => 8)
conn.start

begin
  ch2 = conn.create_channel
  q   = "bunny.examples.recovery.q#{rand}"

  ch2.queue_declare(q, :durable => false)
  ch2.queue_declare(q, :durable => true)
rescue Bunny::PreconditionFailed => e
  puts "Channel-level exception! Code: #{e.channel_close.reply_code}, message: #{e.channel_close.reply_text}"
ensure
  conn.create_channel.queue_delete(q)
end

puts "Disconnecting..."
conn.close

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
bunny-2.11.0.pre1 examples/connection/channel_level_exception.rb
bunny-2.10.0 examples/connection/channel_level_exception.rb
bunny-2.9.2 examples/connection/channel_level_exception.rb
bunny-2.9.1 examples/connection/channel_level_exception.rb
bunny-2.6.7 examples/connection/channel_level_exception.rb
bunny-2.7.4 examples/connection/channel_level_exception.rb
bunny-2.8.1 examples/connection/channel_level_exception.rb
bunny-2.9.0 examples/connection/channel_level_exception.rb
bunny-2.7.3 examples/connection/channel_level_exception.rb
bunny-2.8.0 examples/connection/channel_level_exception.rb
bunny-2.7.2 examples/connection/channel_level_exception.rb
bunny-2.7.1 examples/connection/channel_level_exception.rb
bunny-2.7.0 examples/connection/channel_level_exception.rb
bunny-2.6.6 examples/connection/channel_level_exception.rb
bunny-2.6.5 examples/connection/channel_level_exception.rb
bunny-2.6.4 examples/connection/channel_level_exception.rb
bunny-2.6.3 examples/connection/channel_level_exception.rb
bunny-2.6.2 examples/connection/channel_level_exception.rb
bunny-2.6.1 examples/connection/channel_level_exception.rb
bunny-2.6.0 examples/connection/channel_level_exception.rb