File tree Expand file tree Collapse file tree 5 files changed +10
-12
lines changed Expand file tree Collapse file tree 5 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @nestjstools/messaging-rabbitmq-extension" ,
3- "version" : " 2.12 .0" ,
3+ "version" : " 2.13 .0" ,
44 "description" : " Extension to handle messages and dispatch them over AMQP protocol" ,
55 "author" : " Sebastian Iwanczyszyn" ,
66 "private" : false ,
6666 "@nestjs/core" : " ^11.0.0" ,
6767 "@nestjs/schematics" : " ^11.0.0" ,
6868 "@nestjs/testing" : " ^11.0.0" ,
69- "@nestjstools/messaging" : " ^2.15 .0" ,
69+ "@nestjstools/messaging" : " ^2.21 .0" ,
7070 "@semantic-release/github" : " ^11.0.1" ,
7171 "@types/express" : " ^5.0.0" ,
7272 "@types/jest" : " ^29.5.2" ,
Original file line number Diff line number Diff line change 1- import { Channel } from '@nestjstools/messaging' ;
2- import { AmqpChannelConfig } from '@nestjstools/messaging' ;
1+ import { AmqpChannelConfig , Channel } from '@nestjstools/messaging' ;
32import { RmqChannelConfig as ExtensionAmqpChannelConfig } from './rmq-channel.config' ;
43import { Connection } from 'rabbitmq-client' ;
54
@@ -13,4 +12,9 @@ export class AmqpChannel extends Channel<
1312 super ( config ) ;
1413 this . connection = new Connection ( config . connectionUri ) ;
1514 }
15+
16+ async onChannelDestroy ( ) : Promise < void > {
17+ await this . connection . close ( ) ;
18+ return Promise . resolve ( ) ;
19+ }
1620}
File renamed without changes.
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import { Buffer } from 'buffer';
1212@Injectable ( )
1313@MessageConsumer ( AmqpChannel )
1414export class RabbitmqMessagingConsumer
15- implements IMessagingConsumer < AmqpChannel > , OnApplicationShutdown
15+ implements IMessagingConsumer < AmqpChannel >
1616{
1717 private channel ?: AmqpChannel = undefined ;
1818
@@ -70,12 +70,6 @@ export class RabbitmqMessagingConsumer
7070
7171 return Promise . resolve ( ) ;
7272 }
73-
74- async onApplicationShutdown ( signal ?: string ) : Promise < any > {
75- if ( this . channel ) {
76- await this . channel . connection . close ( ) ;
77- }
78- }
7973}
8074
8175interface RabbitMQMessage {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { AmqpMessageBusFactory } from './message-bus/amqp-message-bus-factory';
33import { AmqpChannelFactory } from './channel/amqp-channel.factory' ;
44import { RabbitmqMessagingConsumer } from './consumer/rabbitmq-messaging.consumer' ;
55import { RabbitmqMigrator } from './migrator/rabbitmq.migrator' ;
6- import { RmqChannelFactory } from './channel/rmq-channel-factory.service ' ;
6+ import { RmqChannelFactory } from './channel/rmq-channel-factory' ;
77
88@Global ( )
99@Module ( {
You can’t perform that action at this time.
0 commit comments