golevelup / nestjs

A collection of badass modules and utilities to help you level up your NestJS applications 🚀
MIT License
2.16k stars 244 forks source link

Queue subscriber not being registered #750

Closed norberto-e-888 closed 3 weeks ago

norberto-e-888 commented 3 weeks ago

I have the following dynamic module that accepts an enum of topics:

Screenshot 2024-06-24 at 1 00 32 PM

I then import it in the root module of one of my services:

Screenshot 2024-06-24 at 1 01 16 PM

This results in the following acknowledgement being logged when I run my service (4th line from bottom): 'Successfully connected a RabbitMQ channel "AmqpConnection'. Also please note the presence of EmailVerificationService in the providers array.

Screenshot 2024-06-24 at 1 02 15 PM

The issue is that despite EmailVerificationService being included in the providers array of the same module where I imported AppRabbitMQModule, and it having a method 'sendEmailVerification' which is decorated with RabbitSubscribe, the queue subscriber is not being registered. I already tried tried making the method public instead of protected, making it protected is just a habit that I have

Screenshot 2024-06-24 at 1 04 23 PM

I've checked my RabbitMQ instance directly via the management console and the topics are being successfully created but the queues are not, and the amqpConnection is being successfully provided as I have a module that would fail otherwise.

Any ideas on what could be causing the issue?