@@ -206,6 +206,7 @@ export class amqpwrapper extends events.EventEmitter {
206206 this . channel = await this . conn . createConfirmChannel ( ) ;
207207 this . channel . prefetch ( Config . amqp_prefetch ) ;
208208 this . replyqueue = await this . AddQueueConsumer ( Crypt . rootUser ( ) , "" , null , null , ( msg : any , options : QueueMessageOptions , ack : any , done : any ) => {
209+ ack ( ) ;
209210 try {
210211 if ( this . replyqueue ) {
211212 if ( ! NoderedUtil . IsNullUndefinded ( WebSocketServer . websocket_queue_message_count ) ) WebSocketServer . websocket_queue_message_count .
@@ -218,7 +219,6 @@ export class amqpwrapper extends events.EventEmitter {
218219 } catch ( error ) {
219220 console . error ( error ) ;
220221 }
221- ack ( ) ;
222222 done ( ) ;
223223 } , undefined ) ;
224224 // We don't want to recreate this
@@ -484,6 +484,7 @@ export class amqpwrapper extends events.EventEmitter {
484484 async Adddlx ( parent : Span ) {
485485 if ( NoderedUtil . IsNullEmpty ( Config . amqp_dlx ) ) return ;
486486 await this . AddExchangeConsumer ( Crypt . rootUser ( ) , Config . amqp_dlx , "fanout" , "" , null , null , true , async ( msg : any , options : QueueMessageOptions , ack : any , done : any ) => {
487+ ack ( ) ;
487488 if ( typeof msg === "string" || msg instanceof String ) {
488489 try {
489490 msg = JSON . parse ( ( msg as any ) ) ;
@@ -509,7 +510,6 @@ export class amqpwrapper extends events.EventEmitter {
509510 console . error ( "Failed sending deadletter message to " + options . replyTo ) ;
510511 console . error ( error ) ;
511512 }
512- ack ( ) ;
513513 done ( ) ;
514514 } , parent ) ;
515515 }
@@ -524,6 +524,7 @@ export class amqpwrapper extends events.EventEmitter {
524524 async AddOFExchange ( parent : Span ) {
525525 if ( ! Config . enable_openflow_amqp ) return ;
526526 await this . AddExchangeConsumer ( Crypt . rootUser ( ) , "openflow" , "fanout" , "" , null , null , true , async ( msg : any , options : QueueMessageOptions , ack : any , done : any ) => {
527+ ack ( ) ;
527528 if ( typeof msg === "string" || msg instanceof String ) {
528529 try {
529530 msg = JSON . parse ( ( msg as any ) ) ;
@@ -566,7 +567,6 @@ export class amqpwrapper extends events.EventEmitter {
566567 } else {
567568 if ( Config . log_amqp ) Logger . instanse . verbose ( "[OF] Received string message: " + JSON . stringify ( msg ) ) ;
568569 }
569- ack ( ) ;
570570 done ( ) ;
571571 } , parent ) ;
572572 }
0 commit comments