From 4a061d2ffed9cd71d41372107ce415a27dae100d Mon Sep 17 00:00:00 2001 From: vhforbes Date: Wed, 30 Oct 2024 12:34:00 -0300 Subject: [PATCH 1/2] feat: requeue when no routing key found --- packages/rabbitmq/src/amqp/connection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rabbitmq/src/amqp/connection.ts b/packages/rabbitmq/src/amqp/connection.ts index ff0fcab21..bce3d529d 100644 --- a/packages/rabbitmq/src/amqp/connection.ts +++ b/packages/rabbitmq/src/amqp/connection.ts @@ -702,9 +702,9 @@ export class AmqpConnection { if ( !matchesRoutingKey(msg.fields.routingKey, rpcOptions.routingKey) ) { - channel.nack(msg, false, false); + channel.nack(msg, false, true); this.logger.error( - 'Received message with invalid routing key: ' + + 'Received message with invalid routing keyy: ' + msg.fields.routingKey, ); return; From f91b2475ca8cc6f5232283d16b30f27dc777b585 Mon Sep 17 00:00:00 2001 From: vhforbes Date: Wed, 30 Oct 2024 12:41:11 -0300 Subject: [PATCH 2/2] fix: typo --- packages/rabbitmq/src/amqp/connection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rabbitmq/src/amqp/connection.ts b/packages/rabbitmq/src/amqp/connection.ts index bce3d529d..f9acbc60f 100644 --- a/packages/rabbitmq/src/amqp/connection.ts +++ b/packages/rabbitmq/src/amqp/connection.ts @@ -704,7 +704,7 @@ export class AmqpConnection { ) { channel.nack(msg, false, true); this.logger.error( - 'Received message with invalid routing keyy: ' + + 'Received message with invalid routing key: ' + msg.fields.routingKey, ); return;