cody-greene / node-rabbitmq-client

RabbitMQ (0-9-1) client library with auto-reconnect & zero dependencies
MIT License
127 stars 9 forks source link

fix: AMQPConnectionError [AMQPError]: client received unexpected method ch1:queue.declare-ok #9

Closed thanakij closed 1 year ago

thanakij commented 1 year ago

I have been using this library but from time to time (2-3 out of 20), I will encounter a mysterious exception from this lib.

I find that the situation is that the order of _resolveCallback calls may not be aligned with _addCallback. This PR tries to find the first item with the same fullName before giving up and throw the exception.

thanakij commented 1 year ago

image

cody-greene commented 1 year ago

// this is a bug; should never happen

And yet here we are... :laughing:

cody-greene commented 1 year ago

This is actually a deeper problem than it appears. But I'll have a fix in a few days.

cody-greene commented 1 year ago

published v3.3.1 Thanks for the bug report. Concurrent use of a single channel should be more reliable now.