Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to define multiple queue in multiple module ? #171

Closed
smonv opened this issue Oct 24, 2019 · 6 comments
Closed

Is it possible to define multiple queue in multiple module ? #171

smonv opened this issue Oct 24, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@smonv
Copy link

smonv commented Oct 24, 2019

When developing an application by NestJS, I want each module can define multiple queue for it own scope. Currently when ever I import BullModule in second module, bull cannot recognize setting from the first module.

This is test repo: https://github.com/smonv/bull-queue-test

With on queue (app) project run just fine. But if I add another queue (sync) in Sync module, I got an error

Screen Shot 2019-10-24 at 10 25 45

@fwoelffel fwoelffel added the bug Something isn't working label Oct 24, 2019
@stevenolay
Copy link

I'm getting this same issue. This wasn't an issue on older Nest Bull versions... but seeing this now

@stevenolay
Copy link

stevenolay commented Oct 25, 2019

I believe it has something to do with the @processor and @process decorators. I cloned your project and commented out the import for the processor and the project successfully built.

Very unfortunate since the decorators really help clean up the code. I guess I'll need to revert to doing it manually. IE. Injecting the queue in the service. in the constructor manually registering the process function callback. by doing injectedQueue.process(this.processingFunction())

@fwoelffel
Copy link
Contributor

Hi guys.
Thanks @smonv for the repro. I'll look into this ASAP because what you're both reproting isn't the expected behavior at all.

@stevenolay You can use this workaround until this is all fixed.

@smonv
Copy link
Author

smonv commented Oct 28, 2019

@fwoelffel Thank for quick reply, hope you can identify the problem soon.

Currently my workaround is create new module, define and re-export all my queue in it like this solution. After that other module can inject the queue to service

@stevenolay
Copy link

stevenolay commented Oct 30, 2019 via email

@kamilmysliwiec
Copy link
Member

Fixed. This change will be published as @nestjs/bull shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants