1
votes

I am trying to send emails from my app using sidekiq. after going through docs I could understand is we are configure the activejob to use sidekiq with config.active_job.queue_adapter = :sidekiq

My problem is, I am using one mailer with 3 different methods to send 3 different emails how should I configure it? Like should I have separate Jobs/workers for each email method? And which is optimized way to use active job or sidekiq worker?

class TestMailer < ApplicationMailer
      def register(customer)
        @customer = customer
        mail(to: @customer.email, subject: 'TEST')
      end

      def success(customer)
        @customer = customer
        mail(to: @customer.email, subject: 'TEST2')
      end
    end

Any pointers will be helpful.

1

1 Answers

0
votes

Benchmarks show that Active Job is 2-20x times slower pushing jobs to Redis and has ~3x the processing overhead (with Rails 5.1.4 and Sidekiq 5.1.1). As with all benchmarks performance can change from version to version, YMMV.

https://github.com/mperham/sidekiq/wiki/Active-Job