[rabbitmq-discuss] rabbitmq-c RPC-style commands doesn't work after amqp_get_rpc_reply return AMQP_RESPONSE_SERVER_EXCEPTION

Alan Antonuk alan.antonuk at gmail.com
Mon Jul 22 17:24:49 BST 2013


This should really go to the whole list....


On Mon, Jul 22, 2013 at 9:21 AM, Alan Antonuk <alan.antonuk at gmail.com>wrote:

> On Mon, Jul 22, 2013 at 12:29 AM, Matthias Radestock <
> matthias at rabbitmq.com> wrote:
>
>>
>> On 22/07/13 07:25, Alan Antonuk wrote:
>>
>>>     - A AMQP_CHANNEL_CLOSE_METHOD means a channel exception has
>>> occurred, you can cast the reply.decoded to amqp_channel_close_t* to get
>>> details on why the channel was closed.  Once a channel has been closed,
>>> it should not be used without reopening the channel with
>>> amqp_channel_open().
>>>
>>
>> Presumably the app should also send back a channel.close_ok; or is that
>> handled by the library?
>>
>> Currently the library does not handle this for.  The app should send a
> channel.close_ok by doing something like
>
> amqp_channel_close_ok_t close_ok;
> int ret = amqp_send_method(conn, channel, AMQP_CHANNEL_CLOSE_OK_METHOD,
> &close_ok);
> if (AMQP_STATUS_OK != ret) {
>  /* Handle any errors sending the method */
> }
>
>
>>
>>      - A AMQP_CONNECTION_CLOSE_METHOD means a connection exception has
>>> occurred. You can cast the reply.decoded to amqp_connection_close_t* to
>>> get details on why the broker closed the connection.  Once the
>>> connection has been closed the entire connection should be destroyed and
>>> a new one created before continuing.
>>>
>>
>> Ditto, but for connection.close_ok.
>
>
> Same deal as with channels, the app is responsible for sending a
> connection.close_ok over channel 0.
>
> Example code for doing this might be:
>
> amqp_connection_close_ok_t close_ok;
> int ret = amqp_send_method(conn, 0, AMQP_CONNECTION_CLOSE_OK_METHOD,
> &close_ok);
> if (AMQP_STATUS_OK != ret) {
>  /* Handle any errors */
> }
> /* This will implicitly close the socket to the broker, and free any
> buffers held by the connection */
> amqp_destroy_connection(conn);
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130722/57c580d1/attachment.htm>


More information about the rabbitmq-discuss mailing list