OptimalBits / bull

Premium Queue package for handling distributed jobs and messages in NodeJS.
Other
15.58k stars 1.43k forks source link

Nestjs Consumer @process() doesn't pick up job from queue to process #2758

Closed Geoelycom closed 4 months ago

Geoelycom commented 4 months ago

Description

I have two Microservices(Auth-service) and (Email-service). these two services are to communicate with each other using Bull. the auth Services produce a job to the queue, which the email service acting as the consumer will consume. the AUTH service successfully produces this job to the queue which I can see using the bull board. here is an example job in the queue from bull-board. WhatsApp Image 2024-07-17 at 04 29 30

The email service is supposed to consume these jobs in the queue, but suddenly it doesn't work anymore. I don't know what design principles I might be missing, but I have combed through the documentation and blog post, and nothing seems to be missing. I have created a test script in my email service to test if the code I wrote works, and it was able to work smoothly, i also created another test consumer script to see if I can get the jobs from the queue, which works successfully well too. but the @process() inside the consumer just won't work. and no errors are being emitted to show that something is wrong. both the email service and auth service share the same Redis instance, i have also checked with the Redis instance to ensure the jobs are being published righty, and they are. I would really appreciate it if anyone can point me to what is missing here. in my code as I am confused about what I am doing wrong

Minimal, Working Test code to reproduce the issue.

https://gist.github.com/Geoelycom/ffe5524c034e00aa45c18dcb647b57d2

(An easy to reproduce test case will dramatically decrease the resolution time.)

Bull version

nestjs/bull "^0.6.3"

Additional information