postwait/node-amqp — pull request #342 by albert-lacki (2014-06-24 02:23:40+00:00)
Title: Support for connection.blocked

I have added support for blocked connection notifications (http://www.rabbitmq.com/connection-blocked.html)

1) When server sends connection.blocked / connection.unblocked an event is emited by Connection object, and the information about being blocked is saved.
2) When someone try to publish to an exchange through blocked connection and callback is provided it returns an error.

I'm not sure if the test case I provided is ok for you, because the only way (AFAIK) to easily simulate desired state is to set vm_memory_high_watermark to 0 using rabbitmqctl. Although it proves that both above works, it might be problematic for someone (or travis etc.) to use rabbitmqctl which often needs root account.

More, if you don't want publishers to fail with error when connection is blocked it is still good for me just to have event emitted from Connection object.