-
Notifications
You must be signed in to change notification settings - Fork 12
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
rake queuebus:subscribe not creating the subscribers #24
Comments
Hi @imi56 That is a little confusing and I hope we can sort it out! Thank you so much for taking the time to write up such a thorough issue! Which environment is this loading? Dev? If so, are the subscribers set up to autoload or eagerload? If they are autoloading, then they may not register in the development environment as that typically autoload all constants and it's the file loading that adds them to the set of subscriptions it could be that they haven't registered themselves yet. In the service that we use that uses subscribers, these files are required explicitly so that they load before we run subscribe. |
Hi @kbacha ,
So my subscribes should also autoload. |
@imi56 Right, autoload may break this since it will only load the files at the time that the constant is referenced, you'll want to make sure that the subscribers are eagerloaded. edit: This is because the queue-bus framework won't know they exist until the files are loaded. It cannot reference the constants because it doesn't know yet that they are subscribers until the
In our codebase, we do this by requiring all the subscribers via a In higher environments, which eagerload by default, this should work correctly. You can verify this by turning off autoload in dev and enabling eagerloading. |
No luck! |
Oh! Ok, so it seems like I may have forgotten to include something else. In addition to making sure that the files are loaded we should also enhance the task
|
Thinking on this more, even if the above solves your issue, I think i'm gonna leave this issue open a bit longer. We should likely have some documentation on setting up with Rails and possibly even a |
Perfect! working peacefully. |
There is no solution available on stackoverflow.
Gem versions:
rails version: 6.0
Here is the full trace of
rake queuebus:subscribe
I am publishing the event (
QueueBus.publish('concern_created', phone: '0000000005')
) fromrails console
. As soon as I publish the event processed count in sidekiq is increased by one.subscribers/base_subscriber.rb
subscribers/concern_subscriber.rb
initializers/sidekiq.rb
config/sidekiq.yml
Note:
rake queuebus:queues
returns onlybus_incoming
The text was updated successfully, but these errors were encountered: