Closed AlexSergey closed 1 year ago
Thanks, I will look into this issue.
I've added event handler on wrong credentials in #71
this.server.on(CONNECT_FAILED, (err) => {
this.logger.error(CONNECT_FAILED_MESSAGE);
this.logger.error(err.err);
if (err.err.message.includes('ACCESS-REFUSED') || err.err.message.includes('403')) {
this.logger.error(WRONG_CREDENTIALS_MESSAGE);
reject(err);
}
});
Released in 2.8.1. Thanks @ponomarevkonst
When I use incorrect password or login in the connections array for my RabbitMQ instance, for example:
The service didn't raise error in the console. I saw only logs:
[Nest] 35783 - 11/21/2022, 10:38:00 PM LOG [InstanceLoader] RMQModule dependencies initialized +0ms [Nest] 35783 - 11/21/2022, 10:38:00 PM LOG [RoutesResolver] MyController {/api}: +2ms
And server didn't show any information just freeze.
This bug reproduced only for 2.8.0 version (tested at nestjs 8.0.0, 9.0.0)
Expected result
If I use 2.7.2 I see:
[Nest] 35783 - 11/21/2022, 10:38:00 PM LOG [InstanceLoader] RMQModule dependencies initialized +0ms [Nest] 35783 - 11/21/2022, 10:38:00 PM LOG [RoutesResolver] MyController {/api}: +2ms [Nest] 36063 - 11/21/2022, 10:41:14 PM ERROR Disconnected from RMQ. Trying to reconnect [Nest] 36063 - 11/21/2022, 10:41:14 PM ERROR undefined [Nest] 36063 - 11/21/2022, 10:41:14 PM ERROR undefined [Nest] 36063 - 11/21/2022, 10:41:14 PM ERROR Error: Handshake terminated by server: 403 (ACCESS-REFUSED) with message "ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile." [Nest] 36063 - 11/21/2022, 10:41:14 PM ERROR undefined [Nest] 36063 - 11/21/2022, 10:41:14 PM ERROR undefined