Project

General

Profile

Actions

Solid Queue configuration

Solid Queue is a Database-backed Active Job backend. I've tested to following install and configuration steps on a fresh Debian/GNU Linux 12 with Redmine 6.0.6 and Solid Queue 1.2.0.

1. Install solid_queue

  1. Add the gem as dependency in Gemfile.local file. If the file doesn't exist, you need to create it.
    gem 'solid_queue'
    
  2. Run bundle install to install the dependency

2. Configure Redmine database to setup tables for solid_queue (single database case)

Run following to

bin/rails solid_queue:install

Write db/migrate/20250701000000_add_solid_queue_tables.rb as following:

cat <<EOF > db/migrate/20250701000000_add_solid_queue_tables.rb
class AddSolidQueueTables < ActiveRecord::Migration[7.2]
  def change
$(sed -e '1 d' -e '$ d' db/queue_schema.rb | sed -e 's|^  |    |')
  end
end
EOF

3. Configure Redmine to use solid_queue as backend

  1. Create config/additional_environment.rb file if the file does not exist by copying the existing example file:
    cp config/additional_environment.rb.example config/additional_environment.rb
    
  2. Add the below config line to the file:
    config.active_job.queue_adapter = :solid_queue
    
  3. Restart Redmine to reload the configuration file.

4. Test the configuration

  1. Browse to Information tab from Redmine Administration page and check the mailer queue value:
      Mailer queue                   ActiveJob::QueueAdapters::SolidQueueAdapter
    
  2. Perform some actions in Redmine in order to trigger some notifications emails. In this step, Redmine only pushes the background jobs to SolidQueue backend.
  3. Temporary start Solid Queue supervisor in order to process the queue and send the emails:
    RAILS_ENV=production bin/jobs start
    

    Output example of startup process:

    I, [2025-07-24T11:53:53.590961 #24399]  INFO -- : SolidQueue-1.2.1 Started Supervisor (40.1ms)  pid: 24399, hostname: "vagrant", process_id: 5, name: "supervisor-9318434042b90e70bf75" 
    I, [2025-07-24T11:53:53.642738 #24405]  INFO -- : SolidQueue-1.2.1 Started Dispatcher (43.7ms)  pid: 24405, hostname: "vagrant", process_id: 6, name: "dispatcher-6709740a9c0eb52cc355", polling_interval: 1, batch_size: 500, concurrency_maintenance_interval: 600
    I, [2025-07-24T11:53:53.647923 #24408]  INFO -- : SolidQueue-1.2.1 Started Worker (42.7ms)  pid: 24408, hostname: "vagrant", process_id: 7, name: "worker-beadd9266ccccca675d0", polling_interval: 0.1, queues: "*", thread_pool_size: 3
    I, [2025-07-24T11:53:53.686615 #24412]  INFO -- : SolidQueue-1.2.1 Started Scheduler (76.3ms)  pid: 24412, hostname: "vagrant", process_id: 8, name: "scheduler-b85c19cbe69292d9a6af", recurring_schedule: ["clear_solid_queue_finished_jobs"]
    

    Output example of job processing:

    I, [2025-07-24T11:54:50.951148 #24408]  INFO -- : [ActiveJob] [Mailer::DeliveryJob] [d02bcf2d-73a3-42e9-a0fb-2832679cfc4b] Performing Mailer::DeliveryJob (Job ID: d02bcf2d-73a3-42e9-a0fb-2832679cfc4b) from SolidQueue(mailers) enqueued at 2025-07-24T11:54:50.682261303Z with arguments: "Mailer", "issue_edit", "deliver_now", {:args=>[#<GlobalID:0x00007a885a2747e8 @uri=#<URI::GID gid://redmine-app/User/1>>, #<GlobalID:0x00007a885a2aff78 @uri=#<URI::GID gid://redmine-app/Journal/1>>]}
    I, [2025-07-24T11:54:51.421949 #24408]  INFO -- : [ActiveJob] [Mailer::DeliveryJob] [d02bcf2d-73a3-42e9-a0fb-2832679cfc4b] Performed Mailer::DeliveryJob (Job ID: d02bcf2d-73a3-42e9-a0fb-2832679cfc4b) from SolidQueue(mailers) in 559.55ms
    

  4. If everything went well, stop the command.

5. Configure Solid Queue supervisor to run as a system service

  1. Write /etc/systemd/system/redmine_solid_queue.service file. example:
    [Unit]
    Description=Solid Queue for Redmine
    After=network.target nss-lookup.target remote-fs.target
    
    [Service]
    Type=simple
    User=vagrant
    Group=vagrant
    WorkingDirectory=/opt/redmine
    Environment=RAILS_ENV=production
    ExecStart=/home/vagrant/.local/share/mise/shims/bundle exec bin/jobs start
    TimeoutSec=300
    ExecReload=/bin/kill -TSTP ${MAINPID}
    ExecStop=/bin/kill -INT ${MAINPID}
    RestartSec=1
    Restart=on-failure
    SyslogIdentifier=redmine_solid_queue
    
    [Install]
    WantedBy=multi-user.target
    
  2. Enable and start the service:
    sudo systemctl enable redmine_solid_queue.service
    sudo systemctl start redmine_solid_queue.service
    
  3. Test again the email notifications

Updated by Nishida Yuya 2 days ago · 1 revisions