From b95041526689d7297a7c33f1f65f5f9d763f2e5d Mon Sep 17 00:00:00 2001 From: Oscar Andersson Date: Wed, 8 Nov 2023 21:28:56 +0100 Subject: [PATCH] feat: add error when queue is not getting emptied properly --- src/utils/rabbitmq.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/rabbitmq.ts b/src/utils/rabbitmq.ts index d8ae6bd..dead2a0 100644 --- a/src/utils/rabbitmq.ts +++ b/src/utils/rabbitmq.ts @@ -49,6 +49,12 @@ export class RabbitMq implements MoveerRabbitMq { durable: true, }); + this.rabbitMqChannel.checkQueue(queue, (err, result) => { + if (result.messageCount > 100) { + reportMoveerError(`Queue ${queue} is getting full!!!!`); + } + }); + this.rabbitMqChannel.sendToQueue( queue, Buffer.from(JSON.stringify(rabbitMqMessage)),