Skip to content

Commit

Permalink
feat(rabbitmq): log the disconnect event from connection manager
Browse files Browse the repository at this point in the history
When the node-amqp-connection-manager disconnects it emits an event. This event is now ignored and
therefore it is not visisble what the disconnect reason is. This is usefull information
  • Loading branch information
arjenvdhave authored May 17, 2021
1 parent a92e186 commit 9fa5708
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/rabbitmq/src/amqp/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ export class AmqpConnection {
this.logger.log('Successfully connected to a RabbitMQ broker');
});

this._managedConnection.on('disconnect', ({ err }) => {
this.logger.error('Disconnected from RabbitMQ broker', err?.stack);
});

this._managedChannel = this._managedConnection.createChannel({
name: AmqpConnection.name,
});
Expand Down

0 comments on commit 9fa5708

Please sign in to comment.