-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
fix(microservices): adds feedback message when RabbitMQ server connection hangs #9751
fix(microservices): adds feedback message when RabbitMQ server connection hangs #9751
Conversation
Pull Request Test Coverage Report for Build fe9290e2-9103-4c52-a729-c9dcd92384d8
💛 - Coveralls |
I wonder if wouldn't be better (more flexible) if we just expose the underlying server by returning |
I'm not sure if that would solve the issue. Do you know if by returning it we would prevent the server retrying to start? Because the current issue is that we're stuck in a loop were the server keeps trying to connection and the event we receive from the RabbitMQ client is not being handled by our server, so we don't get any log message in the terminal |
it still won't. I'm unsure if there is any other way to listen to that |
I ran a few quick tests here, it seems the RabbitMQ client has this built-in feature of retrying the connection if it fails. What do you think should be the optimal approach from NestJS perspective (ignoring RabbitMQ client)?
I think how we handle this depends on that decision 🤔 |
@delucca what you did here in this PR is correct and aligns with other transporters. Thank you! |
Hello, |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #9749
If a RabbitMQ connection fails, NestJS keeps trying to reconnect but no log message is dispatched. So, the user thinks the server frozen and it is not doing anything else.
What is the new behavior?
Upon a failed connection on the RabbitMQ server, I've added an error log to show what happened to the user.
Does this PR introduce a breaking change?
Other information
At first we were considering that #9726 was also impacted by this issue, but it isn't, since this is specific to how RabbitMQ handles failed connection attempts.