@@ -16,6 +16,7 @@ import {
1616 RQM_DEFAULT_QUEUE ,
1717 RQM_DEFAULT_QUEUE_OPTIONS ,
1818 RQM_DEFAULT_URL ,
19+ RQM_DEFAULT_NO_ASSERT ,
1920} from '../constants' ;
2021import { RmqUrl } from '../external/rmq-url.interface' ;
2122import { ReadPacket , RmqOptions , WritePacket } from '../interfaces' ;
@@ -38,6 +39,7 @@ export class ClientRMQ extends ClientProxy {
3839 protected responseEmitter : EventEmitter ;
3940 protected replyQueue : string ;
4041 protected persistent : boolean ;
42+ protected noAssert : boolean ;
4143
4244 constructor ( protected readonly options : RmqOptions [ 'options' ] ) {
4345 super ( ) ;
@@ -51,6 +53,9 @@ export class ClientRMQ extends ClientProxy {
5153 this . getOptionsProp ( this . options , 'replyQueue' ) || REPLY_QUEUE ;
5254 this . persistent =
5355 this . getOptionsProp ( this . options , 'persistent' ) || RQM_DEFAULT_PERSISTENT ;
56+ this . noAssert =
57+ this . getOptionsProp ( this . options , 'noAssert' ) || RQM_DEFAULT_NO_ASSERT ;
58+
5459 loadPackage ( 'amqplib' , ClientRMQ . name , ( ) => require ( 'amqplib' ) ) ;
5560 rqmPackage = loadPackage ( 'amqp-connection-manager' , ClientRMQ . name , ( ) =>
5661 require ( 'amqp-connection-manager' ) ,
@@ -143,7 +148,9 @@ export class ClientRMQ extends ClientProxy {
143148 this . getOptionsProp ( this . options , 'isGlobalPrefetchCount' ) ||
144149 RQM_DEFAULT_IS_GLOBAL_PREFETCH_COUNT ;
145150
146- await channel . assertQueue ( this . queue , this . queueOptions ) ;
151+ if ( ! this . queueOptions . noAssert ) {
152+ await channel . assertQueue ( this . queue , this . queueOptions ) ;
153+ }
147154 await channel . prefetch ( prefetchCount , isGlobalPrefetchCount ) ;
148155
149156 this . responseEmitter = new EventEmitter ( ) ;
0 commit comments