-
Notifications
You must be signed in to change notification settings - Fork 334
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
Using sneakers - Rails 5 - Active Job #243
Comments
I noticed that it doesn't automatically create queues and that I have to use the default exchange for anything to work, or setup manual bindings if I use a custom exchange as described in the How To using 'sneakers' as an exchange. This mostly seems to be RabbitMQ-specific, and maybe it was due to newer version of the broker I'm using. After going through this for the past few days it doesn't seem that this gem is a drop-in replacement for resque. |
@quidproquo I don't think this gem claims to be a replacement for Resque. RabbitMQ has a different feature set: if you use a custom exchange, in many cases it's up to you to ensure that the bindings you need exist. Hutch is an example of a project that's highly opinionated and tries to hide the topology from the user but it's also fairly limited for exactly that reason. |
@jondot do we think this is something that should go into a |
Sure! I'm just putting down things on a scratch note, these will be great topics to discuss in our upcoming meeting. |
@gabrieljoelc @jondot so what is the current way to get this to work? |
@ilyakatz I did find a blog post with someone that got it working. They call the class PrimaryWorker
include Sneakers::Worker
from_queue :primary
def work(msg)
job_data = ActiveSupport::JSON.decode(msg)
ActiveJob::Base.execute job_data
ack!
end
end and then enqueue messages against your ActiveJob subtype: MyActiveJobSubTypeThatDoesStuffForMyUsers.perform_later() the author finishes with handling errors and retries. We don't need to add anything specific to the library. We'd love contributions to the wiki (for example). I'll leave this open until that's done. |
This adapter handles it https://github.com/veeqo/advanced-sneakers-activejob |
hi all, just wanted to add my 2 cents. we have a heavy workload and currently using sidekiq. i wanted to evaluate how rabbitmq & sneakers would help us there and i'm kind of happy with the overall result. there are three pain points for us here:
i think sneakers should only handle the first point as i think its rabbitmq's job to support delayed queues. also i don't think rails devs would let us pass around exchange options or routing options. we don't have any of these problems if we just don't use ActiveJob and adapt Sneakers::Worker. p.s. this is not a complaint, just a reference point for people who'd like to evaluate sneakers & activejob in the future. |
@mengu have you tried advanced sneakers adapter for activejob? It covers all problems you've listed |
Very early days but can I vouch that @sharshenov 's gem has got me off the ground with ActiveJob - I was a bit stuck with the standard Sneakers backend. I'll update my comment if I run into any issues. Thanks for the time & effort, @sharshenov . |
I am using sneakers with Rails 5 and ActiveJob with following setup:
Under
application.rb
I haveSneakers configurations is under:
My job is
When I run
rake sneakers:run
it shows following logsBut it does not process any of the job. There are few messages available in that particular queue.
What I am doing wrong here?
The text was updated successfully, but these errors were encountered: