postwait / node-amqp

[UNMAINTAINED] node-amqp is an AMQP client for nodejs
MIT License
1.69k stars 357 forks source link

When confirm:true, don't consider exchange open until confirmSelectOk #330

Closed mike-lang closed 9 years ago

mike-lang commented 10 years ago

If we don't do this the open callback for the exchange may fire prior to this._sequence gets initialized, so the code that handles confirmation acks won't match the values saved on messages awaiting confirmation and the confirmation callback never fires.

I'd have contributed tests, but I can't get the test suite to pass on my machine in a clean clone of postwait/master. Regardless, I thought I'd submit anyway. Without this change, the callback passed into exchange.publish never fires, and with it things work as expected within my application.