Nest.js has trouble connecting to RabbitMQ with latest amqp-connection-manager

See original GitHub issue

Hey nest.js folks!

I’m the maintainer of amqp-connection-manager. I’ve been making some attempts to modernize the code in this library lately - many years ago it was originally written in CoffeeScript, then migrated to JavaScript. Recently I merged a number of fixes from contributors, and I migrated the whole codebase to typescript.

The typescript migration happened between 3.3.0 and 3.4.0, and somehow this specific release is causing some problems for some nest.js users. They’re seeing:

Error: Channel closed by server: 406 (PRECONDITION-FAILED) with message "PRECONDITION_FAILED - fast reply consumer does not exist"

This is a weird error - usually this would be caused by someone trying to post a message with a replyTo: 'amq.rabbitmq.reply-to' before setting up a consumer listening on that queue (as per this). This sounds like a bug outside of amqp-connection-manager… except all the users claim they can reliably get this to work with 3.3.0 and not with 3.4.0. The changes I made between 3.3.0 and 3.4.0 are pretty mild, and I don’t see how any of them could be somehow causing this error (although, clearly something has changed). Doubly unfortunately, while lots of users are running into this problem, if I try this demo repo it works fine, and no one has been able to generate a minimal test case that reproduces this.

Since I’m not a nest.js user, I’m reaching out to see if anyone familiar with the nest.js RabbitMQ transport has any clever ideas about what could be could be causing this problem or thoughts about ways to recreate it. (I’m essentially grasping at straws here. -_-)

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:9
  • Comments:24 (8 by maintainers)

github_iconTop GitHub Comments

30reactions
jwaltoncommented, Oct 27, 2021

Hey folks. I wanted to appologize - I kind of raised this issue and then abandoned it. My mom passed away very unexpectedly right after I raised this, and… well… It’s been a rough couple of months. Thanks to everyone for helping get this fixed!

8reactions
kamilmysliwieccommented, Sep 28, 2021

Fixed in 8.0.8

Read more comments on GitHub >

github_iconTop Results From Across the Web

NesJS RabbitMQ with @golevelup/nestjs ... - Stack Overflow
Found the problem, I was using the connection in a onApplicationBootstrap method and then the connection is apparently not present yet.
Read more >
RabbitMQ - Microservices - A progressive Node.js framework
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines ...
Read more >
amqp-connection-manager - npm
Automatically reconnect when your amqplib broker dies in a fire. Round-robin connections between multiple brokers in a cluster. If messages are ...
Read more >
nestjs-rabbitmq-consumers - npm package - Snyk
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fix ...
Read more >
amqplib | Channel API reference - GitHub Pages
Error events emitted from a channel (or a connection) have the potential to ... amqp.connect().then(function(conn) { // Everything ok, but .. throw new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found