[rabbitmq-discuss] Rabbitmq-C amqp_basic_publish crash on connection loss
Alan Antonuk
alan.antonuk at gmail.com
Thu Oct 10 07:55:41 BST 2013
If used correctly, rabbitmq-c should not cause your program to terminate.
I would need a bit more information by what you mean by "program
terminated" to help you diagnose your issue. Did it segfault? Did it
abort()? If so, is there a callstack indicating where this happened?
On Wed, Oct 9, 2013 at 5:56 AM, Lothe Shashank <
Shashank.Lothe at techmahindra.com> wrote:
> 1. if there is a way to check the connection before I publish
>
No, and even if there was, its entirely possible that the connection could
be closed between the time the program checked to see if the connection was
open and the time amqp_basic_publish() was called.
> 2. if the connection value becomes NULL, as we stop the broker.
>
amqp_connection_state_t objects are only allocated with
amqp_new_connection(), and only deallocated with amqp_destroy_connection().
No other function in rabbitmq-c should change the external facing value of
an amqp_connection_state_t. Its an opaque pointer.
http://stackoverflow.com/a/7553775/786714 for a better explanation on the
pattern in use here.
-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131009/7b8f7e70/attachment.htm>
More information about the rabbitmq-discuss
mailing list