golevelup / nestjs

A collection of badass modules and utilities to help you level up your NestJS applications 🚀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RabbitSubscribe re-queue message even if the function has not throw any error

EladIsraeli opened this issue · comments

This is an example

 @RabbitSubscribe({
        queue: 'xxx',
    })
    public async consumeMessage(msg: DTO) {
            await this.postGetMetricsResponse.execute(msg)
    }

For some reason even if the whole logic inside the execute is finished without any throw Error or rejection, The message that arrives from the queue above is kind of requeue and the consumeMessage is re triggered again.

First I'm wondering why? maybe I miss something, I throw up some ideas maybe it is related to prefetch count?
something about channels? maybe the queue is not configured well?
Can someone give some light on how to investigate it.
Second can I somehow debug the internal code of the rabbitSubscribe I might found out that something about requeue happening.

And Third I got this INFO log from RabbitSubscribe, I'm not sure what does it mean, can someone put some light on that as well.

Received response: [{}] from subscribe handler [consumeMessage]. Subscribe handlers should only return void

If that's help I can attach here screenshot from how it looks like on the rabbitmq UI

image

I'm not sure I understand why it behaves like that.

Understood that The issue is applicative.