[rabbitmq-discuss] Quries about amqp_channel_close.

Alan Antonuk alan.antonuk at gmail.com
Thu Jan 2 18:07:25 GMT 2014


On Wed, Jan 1, 2014 at 11:31 PM, Rohit Patle
<Rohit.Patel2 at techmahindra.com>wrote:

>  Hi,
> I am using rabbitmq-c with following specifications:
> Name: Librabbitmq
> Description: An AMQP 0-9-1 client library
> Client library Version: 0.3.0
> Rabbitmq server Version: 3.2.2-1

I would highly recommend upgrading to v0.4.1 if possible, as there have
been several improvements around error handling since v0.3.0.

> 1. I am trying to close the channel and getting theAMQP_RESPONSE_LIBRARY_EXCEPTIONin amqp_channel_close API. Can you tell me what are the different reason
> for :


Hopefully you never see an AMQP_RESPONSE_NONE - as that would likely
indicate a bug somewhere.

> 2. What will be the implication if I call amqp_destroy_connection without
> calling amqp_connection_close, amqp_queue_unbind and amqp_queue_delete?
> Will it release all the internal resources acquired while creating the
> connection? In other words, is there any need to call these APIs if I am
> going to call amqp_destroy_connection API alone?

Calling amqp_destroy_connection without calling amqp_connection_close first
will cause the underlying socket to be closed without sending the
connection.close method to the broker. This should not leak any resources
on the client side.  On the broker side the broker will eventually detect
that the socket has been closed and will emit a warning to the error log
indicating that a connection closed unexpectedly.

As for amqp_queue_unbind and amqp_queue_delete, these only manipulate
objects defined on the broker. A queue may or may not hang around after a
client disconnects depending on how it was declared. A queue binding will
hang around as long as both the exchange and queue still exist.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140102/80145ba5/attachment.html>

More information about the rabbitmq-discuss mailing list