This blog is part of our Rails 5 series.
Before Rails 5 we had ability to configure Active Job
queue_adapter at an application level.
If we want to use
sidekiq as our backend queue adapter we would configure it as following.
queue_adapter would be applicable to all jobs.
Rails 5 provides ability to configure
on a per job basis.
queue_adapter for one job can be different to that of the other job.
Let’s suppose we have two jobs in our brand new Rails 5 application.
EmailJob is responsible for
processing basic emails
NewsletterJob sends out news letters.
We are now able to configure
sidekiq queue adapter for
In case of
NewsletterJob we fallback to the global default adapter which
in case of a new Rails 5 app
Moreover, in Rails 5, when one job inherits other job, then queue adapter of the parent job gets persisted in the child job unless child job has configuration to change queue adapter.
Since news letters are email jobs we can make
Below is an example where
EmailJob is using
NewsLetterJob is using