ruby-amqp/amqp — Issue #116: channel.confirm_select only works when inside a Channel.new() {} block
Author: copiousfreetime
Created: 2012-01-28 23:34:18+00:00
State: open

I was attempting to test out using the RabbitMQ Publisher Confirms feature, which is implemented in ruby-amqp via `AMQP::Channel#confirm_select`. The example gist https://gist.github.com/923599 shows its use when a new `AMQP::Channel` is created and then yields a block. If you do it another way https://gist.github.com/1696255 without yielding a block you will receive:

```sh
Connecting to AMQP broker. Running 0.9.2 version of the gem...
Channel 1 is now open
/Users/jeremy/.rvm/gems/ruby-1.8.7-p357@queue/gems/amq-client-0.9.1/lib/amq/client/async/adapters/event_machine.rb:164:in `initialize': AMQP broker closed TCP connection before authentication succeeded: this usually means authentication failure due to misconfiguration. Settings are {:pass=>"guest", :ssl=>false, :broker=>nil, :user=>"guest", :logging=>false, :host=>"127.0.0.1", :vhost=>"/", :port=>5672, :frame_max=>131072, :timeout=>nil} (AMQP::PossibleAuthenticationFailureError)
```