CopernicaMarketingSoftware / AMQP-CPP

C++ library for asynchronous non-blocking communication with RabbitMQ
Apache License 2.0
879 stars 340 forks source link

Notification for blocked connection #443

Open neha2007 opened 2 years ago

neha2007 commented 2 years ago

Describe the bug Alarm Notification is not received when the RMQ connection is in blocked state due to reaching the disk space low watermark.

Expected behavior and actual behavior Alarm should be received. But no indication is received by the publisher client. Hence the publisher keeps on publishing the messages even though the connection is in blocked state.

https://www.rabbitmq.com/connection-blocked.html

neha2007 commented 2 years ago

@EmielBruijntjes please let me know how can this be achieved?

EmielBruijntjes commented 2 years ago

AMQP-CPP does not yet support this. You will need to send in a pull request to add this feature. The way I see it now, you can add two methods to the AMQP::Handler class:

virtual void onBlocked(AMQP::Connection *);
virtual void onUnblocked(AMQP::Connection *);

Every time that we receive a 'blocked' or 'unblocked' frame we can then call these methods.