Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When closing MQ Connection getting "An unexpected method was received" error #821

Open
vikirj opened this issue Mar 8, 2024 · 2 comments

Comments

@vikirj
Copy link

vikirj commented Mar 8, 2024

When waiting for consuming message using amqp_consume_message(connection, &envelope, NULL, 0) function.
if close the channel and connection without receiving any message ,

die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel"); die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), "Closing connection"); die_on_error(amqp_destroy_connection(conn), "Ending connection");

it throws An unexpected method was received 1310761 or An unexpected method was received 655411 error some time.
some times the connection gets closed successfully.

could you please let us know the 1310761 and 655411 this code meaning.

Note: using v0.11.0 version

@alanxz
Copy link
Owner

alanxz commented Mar 9, 2024

1310761 - is the channel.close method link

655411 - is the connection.close method link

@vikirj
Copy link
Author

vikirj commented Mar 11, 2024

Thanks for the response.

When I close the channel ( 1310761 - code returns ). and I could not close the connection after.

(i.e)

if I call die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel");
then

amqp_consume_message(conn, &envelope, NULL, 0); - this message-consumption function exits.

(amqp_rpc_reply_t ret) its reply_type is AMQP_RESPONSE_LIBRARY_EXCEPTION and library_error AMQP_STATUS_SOCKET_ERROR (or) AMQP_STATUS_UNEXPECTED_STATE

log:

ret.reply_type : 2 ret.library_error : -9 (or) -16

when this error is received, I could not close and destroy the connection and the following 2 functions are NOT called:

die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), "Closing connection"); 
die_on_error(amqp_destroy_connection(conn), "Ending connection");

and the application still running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants