fix(microservices): adds logging to failed rmq connection

This commit is contained in:
delucca
2022-06-10 16:21:14 -04:00
parent ad39c3cfd7
commit a3258d5fbb
2 changed files with 10 additions and 1 deletions

View File

@@ -5,8 +5,10 @@ import {
} from '@nestjs/common/utils/shared.utils';
import {
CONNECT_EVENT,
DISCONNECTED_RMQ_MESSAGE,
CONNECT_FAILED_EVENT,
CONNECTION_FAILED_MESSAGE,
DISCONNECT_EVENT,
DISCONNECTED_RMQ_MESSAGE,
NO_MESSAGE_HANDLER,
RQM_DEFAULT_IS_GLOBAL_PREFETCH_COUNT,
RQM_DEFAULT_NOACK,
@@ -95,6 +97,10 @@ export class ServerRMQ extends Server implements CustomTransportStrategy {
this.logger.error(DISCONNECTED_RMQ_MESSAGE);
this.logger.error(err);
});
this.server.on(CONNECT_FAILED_EVENT, (err: any) => {
this.logger.error(CONNECTION_FAILED_MESSAGE);
this.logger.error(err);
});
}
public createClient<T = any>(): T {