[rabbitmq-discuss] rabbitmq-c RPC-style commands doesn't work after amqp_get_rpc_reply return AMQP_RESPONSE_SERVER_EXCEPTION
alan.antonuk at gmail.com
Mon Jul 22 07:25:07 BST 2013
On Tue, Jul 16, 2013 at 11:39 PM, Michael Klishin <
michael.s.klishin at gmail.com> wrote:
> I assume AMQP_RESPONSE_SERVER_EXCEPTION indicates
> a channel exception. You need to investigate what exactly causes
> it (see the log) or use a new channel.
Not quite. In rabbitmq-c when you're looking at a amqp_rpc_reply_t
structure, returned from a function like amqp_login, or when
amqp_queue_declare() returns NULL and you use amqp_get_rpc_reply() to get
the last error).
First examine the reply_type.
* AMQP_RESPONSE_NORMAL means the operation completed successfully
* AMQP_RESPONSE_SERVER_EXCEPTION means either a channel or a connection
exception has occurred. You should then examine the reply.id.
- 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().
- 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
* AMQP_RESPONSE_LIBRARY_EXCEPTION means something occurred in the library
(usually it means a socket error has occurred). You should examine
library_error and compare it against the amqp_status_enum values.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss