Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: bubble channel failures up to the connection
Send channel failures up to the connection so that they can be handled appropriately. Previously, errors on channels caused silent failures which could result in queues being unable to receive messages without any indication of failure, such as described in arobson#155. This approach is a bit naive in that it causes the whole connection to fail when an a single channel fails, but I don't think the abstractions in this library allow for the user to respond to channel-level events. In my case, this type of failure occurred any time my consumers lost their connection to the RabbitMQ cluster and tried to send an ack for an old delivery tag to a different RMQ node in the cluster (i.e. queue is re-established on new node and batch acks send after reconnecting). This would result in the following error in amqplib: Error: Channel closed by server: 406 (PRECONDITION-FAILED) with message "PRECONDITION_FAILED - unknown delivery tag 42" But from the perspective of foo-foo-mq/rabbot, everything was fine. With these changes in place, I can at least listen for a `failed` event on the broker and respond appropriately.
- Loading branch information