File tree Expand file tree Collapse file tree
packages/microservices/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { EventEmitter } from 'events';
55import { fromEvent , merge , Observable } from 'rxjs' ;
66import { first , map , share , switchMap } from 'rxjs/operators' ;
77import {
8+ DISCONNECTED_RMQ_MESSAGE ,
89 DISCONNECT_EVENT ,
910 ERROR_EVENT ,
1011 RQM_DEFAULT_IS_GLOBAL_PREFETCH_COUNT ,
@@ -52,6 +53,8 @@ export class ClientRMQ extends ClientProxy {
5253 public close ( ) : void {
5354 this . channel && this . channel . close ( ) ;
5455 this . client && this . client . close ( ) ;
56+ this . channel = null ;
57+ this . client = null ;
5558 }
5659
5760 public consumeChannel ( ) {
@@ -138,9 +141,10 @@ export class ClientRMQ extends ClientProxy {
138141
139142 public handleDisconnectError ( client : any ) : void {
140143 client . addListener ( DISCONNECT_EVENT , ( err : any ) => {
144+ this . logger . error ( DISCONNECTED_RMQ_MESSAGE ) ;
145+ this . logger . error ( err ) ;
146+
141147 this . close ( ) ;
142- this . client = null ;
143- return this . logger . error ( err ) ;
144148 } ) ;
145149 }
146150
You can’t perform that action at this time.
0 commit comments