Project

General

Profile

Is Sidekiq Unnecessary for Sending Emails?

Added by Tadashi Oh-Ya 12 days ago

Hi, there

In EmailConfiguration, it says:

Rails ActiveJob module which sends emails asynchronously

If asynchronous processing is required in the production environment, why does a warning icon appear in admin/info at the section "Default queue adapter which is well suited only for dev/test changed" in the default installation state?

Kind regards,


Replies (2)

RE: Is Sidekiq Unnecessary for Sending Emails? - Added by Holger Just 11 days ago

Mails are always processed asynchronously.

By default, we use a very simply queue implementation (ActiveJob::QueueSdapters::AsyncAdapter which processes background jobs in a separate thread of your application server process. This however is prone to lost jobs as the scheduled background jobs (such as sending notification mails) are not stored in the database. If the job is not successful or the application server process dies for any reason, the currently running and any further scheduled jobs are lost.

The advantage of this default queue (and the reason why we use it by default) is that is does not require to maintain a separate process (and Redis database) to process the background jobs. This can reduce the environment requirements of Redmine. For a production environment, it is still likely a better idea to move to a durable queueing implementation

Because of that, we recommend to setup a separate durable queue. We generally support all implementations which are supported by ActiveJob. This includes

  • Sidekiq (which stores scheduled jobs in a Redis database)
  • Resque (likewise)
  • DelayedJob (which can store jobs in your Redmine database)
  • likely also solid_queue (which can also stores jobs in the Redmine database). I have not personally tested this though.
  • and others

RE: Is Sidekiq Unnecessary for Sending Emails? - Added by Tadashi Oh-Ya 11 days ago

Thank you for your reply.

If the job is not successful or the application server process dies for any reason, the currently running and any further scheduled jobs are lost.

I see. I had overlooked this perspective.
This time, I have introduced Sidekiq.

When Redmine starts using Rails 8.x, can we expect solid_queue https://guides.rubyonrails.org/active_job_basics.html#production to be adopted as the default?

Kind regards,

    (1-2/2)