Skip to content

Commit

Permalink
feat: add error when queue is not getting emptied properly
Browse files Browse the repository at this point in the history
  • Loading branch information
winbergoscar0 committed Nov 8, 2023
1 parent 199ab56 commit b950415
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/rabbitmq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down

0 comments on commit b950415

Please sign in to comment.