You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-3
Original file line number
Diff line number
Diff line change
@@ -25,13 +25,13 @@ Solid Queue can be used with SQL databases such as MySQL, PostgreSQL or SQLite,
25
25
-[Concurrency controls](#concurrency-controls)
26
26
-[Failed jobs and retries](#failed-jobs-and-retries)
27
27
-[Error reporting on jobs](#error-reporting-on-jobs)
28
+
-[Monitoring](#monitoring)
28
29
-[Puma plugin](#puma-plugin)
29
30
-[Jobs and transactional integrity](#jobs-and-transactional-integrity)
30
31
-[Recurring tasks](#recurring-tasks)
31
32
-[Inspiration](#inspiration)
32
33
-[License](#license)
33
34
34
-
35
35
## Installation
36
36
37
37
Solid Queue is configured by default in new Rails 8 applications. But if you're running an earlier version, you can add it manually following these steps:
@@ -114,6 +114,7 @@ plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] || Rails.env.development?
114
114
```
115
115
116
116
You can also just use `bin/jobs`, but in this case you might want to [set a different logger for Solid Queue](#other-configuration-settings) because the default logger will log to `log/development.log` and you won't see anything when you run `bin/jobs`. For example:
@@ -492,6 +493,8 @@ failed_execution.discard # This will delete the job from the system
492
493
493
494
However, we recommend taking a look at [mission_control-jobs](https://github.com/rails/mission_control-jobs), a dashboard where, among other things, you can examine and retry/discard failed jobs.
494
495
496
+
For applications that need a lightweight solution, especially Rails API-only applications, [solid_queue_monitor](https://github.com/vishaltps/solid_queue_monitor) is an excellent alternative. It provides a zero-dependency web interface for monitoring Solid Queue background jobs with all the essential features for managing jobs, including examining and retrying/discarding failed jobs. Its minimal footprint makes it perfect for API-only Rails applications where you want to avoid adding additional dependencies.
497
+
495
498
### Error reporting on jobs
496
499
497
500
Some error tracking services that integrate with Rails, such as Sentry or Rollbar, hook into [Active Job](https://guides.rubyonrails.org/active_job_basics.html#exceptions) and automatically report not handled errors that happen during job execution. However, if your error tracking system doesn't, or if you need some custom reporting, you can hook into Active Job yourself. A possible way of doing this would be:
@@ -519,22 +522,55 @@ class ApplicationMailer < ActionMailer::Base
519
522
end
520
523
```
521
524
525
+
## Monitoring
526
+
527
+
Solid Queue provides various ways to monitor your background jobs. You can use these tools to view job statistics, track job status, manage failed jobs, and more.
528
+
529
+
### Solid Queue Monitor
530
+
531
+
For applications that need a lightweight solution, especially Rails API-only applications, [solid_queue_monitor](https://github.com/vishaltps/solid_queue_monitor) is an excellent option. Key features include:
532
+
533
+
- Zero dependencies - works out of the box for Rails API applications
534
+
- Dashboard overview of job queues
535
+
- Job filtering by class, queue name, and status
536
+
- Failed job inspection and management
537
+
- Recurring job monitoring
538
+
- Responsive design that works on mobile devices
539
+
540
+
Its minimal footprint makes it perfect for API-only Rails applications or projects where you want to avoid additional dependencies.
541
+
542
+
### Mission Control Jobs
543
+
544
+
[mission_control-jobs](https://github.com/rails/mission_control-jobs) is the officially supported dashboard for Solid Queue. It provides a comprehensive interface for monitoring and managing your background jobs with features like:
545
+
546
+
- Statistics and analytics for job processing
547
+
- Job filtering and searching
548
+
- Detailed error information for failed jobs
549
+
- Ability to retry and discard failed jobs
550
+
- Support for recurring jobs management
551
+
552
+
As a full-featured Rails engine, it comes with more dependencies but offers a rich user experience.
553
+
522
554
## Puma plugin
523
555
524
556
We provide a Puma plugin if you want to run the Solid Queue's supervisor together with Puma and have Puma monitor and manage it. You just need to add
557
+
525
558
```ruby
526
559
plugin :solid_queue
527
560
```
561
+
528
562
to your `puma.rb` configuration.
529
563
530
564
If you're using Puma in development but you don't want to use Solid Queue in development, make sure you avoid the plugin being used, for example using an environment variable like this:
565
+
531
566
```ruby
532
567
plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
533
568
```
534
-
that you set in production only. This is what Rails 8's default Puma config looks like. Otherwise, if you're using Puma in development but not Solid Queue, starting Puma would start also Solid Queue supervisor and it'll most likely fail because it won't be properly configured.
535
569
570
+
that you set in production only. This is what Rails 8's default Puma config looks like. Otherwise, if you're using Puma in development but not Solid Queue, starting Puma would start also Solid Queue supervisor and it'll most likely fail because it won't be properly configured.
536
571
537
572
## Jobs and transactional integrity
573
+
538
574
:warning: Having your jobs in the same ACID-compliant database as your application data enables a powerful yet sharp tool: taking advantage of transactional integrity to ensure some action in your app is not committed unless your job is also committed and vice versa, and ensuring that your job won't be enqueued until the transaction within which you're enqueuing it is committed. This can be very powerful and useful, but it can also backfire if you base some of your logic on this behaviour, and in the future, you move to another active job backend, or if you simply move Solid Queue to its own database, and suddenly the behaviour changes under you. Because this can be quite tricky and many people shouldn't need to worry about it, by default Solid Queue is configured in a different database as the main app.
539
575
540
576
Starting from Rails 8, an option which doesn't rely on this transactional integrity and which Active Job provides is to defer the enqueueing of a job inside an Active Record transaction until that transaction successfully commits. This option can be set via the [`enqueue_after_transaction_commit`](https://edgeapi.rubyonrails.org/classes/ActiveJob/Enqueuing.html#method-c-enqueue_after_transaction_commit) class method on the job level and is by default disabled. Either it can be enabled for individual jobs or for all jobs through `ApplicationJob`:
0 commit comments