[rabbitmq-discuss] rabbitmq-c: how to detect broker failure

Jain, Punit Punit.Jain at emc.com
Mon Oct 7 14:01:42 BST 2013


Thank you, Alan.
Yes, I mean "broker failure" in the same sense as you have explained. I am using AMQP_RESPONSE_LIBRARY_EXCEPTION as an indication of broker failure. What does "library_error = 0" signify with that exception?

- Punit


From: rabbitmq-discuss-bounces at lists.rabbitmq.com [mailto:rabbitmq-discuss-bounces at lists.rabbitmq.com] On Behalf Of Alan Antonuk
Sent: Monday, October 07, 2013 11:47 AM
To: Jain, Punit
Cc: rabbitmq-discuss at lists.rabbitmq.com
Subject: Re: [rabbitmq-discuss] rabbitmq-c: how to detect broker failure

It depends on what you mean by "broker failure".

If you mean the broker hardware dies, the broker crashes, or (more likely) something interrupts the network: you'll get an network error on the client side.  In rabbitmq-c this manifests itself in different ways depending on the function being called: for functions returning an int, a non-zero value is returned, for functions returning an amqp_rpc_reply_t, type will be set to AMQP_RESPONSE_LIBRARY_EXCEPTION and library_error will be set to something non-zero, and for things returning a amqp_*_t object if a NULL value is returned, calling amqp_get_last_rpc_reply() will get an amqp_rpc_reply_t which the above rule should be followed.

HTH
-Alan

On Fri, Oct 4, 2013 at 6:13 AM, Jain, Punit <Punit.Jain at emc.com<mailto:Punit.Jain at emc.com>> wrote:
Hi,
I am using rabbitmq-c amqp client (0.2.0) to publish messages to RabbitMQ broker. I want to be notified in case of broker failure. Is there a way to detect this?
Any method or exception, which may notify us about this error while establishing a connection or publishing message?

Thanks,
Punit

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131007/68aa75f8/attachment.htm>


More information about the rabbitmq-discuss mailing list