Download the PHP package sbourdette/laravel-mongo-queue-monitor without Composer
On this page you can find all versions of the php package sbourdette/laravel-mongo-queue-monitor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sbourdette/laravel-mongo-queue-monitor
More information about sbourdette/laravel-mongo-queue-monitor
Files in sbourdette/laravel-mongo-queue-monitor
Package laravel-mongo-queue-monitor
Short Description Queue Monitoring for Laravel MongoDb Job Queue
License MIT
Informations about the package laravel-mongo-queue-monitor
Laravel Mongo Queue Monitor
This package offers monitoring like Laravel Horizon for MongoDB database queue.
This package is a fork of romanzipp's laravel-queue-monitor
This package require Jenssegers laravel-mongodb
Features
- Monitor jobs like Laravel Horizon for any queue
- Handle failing jobs with storing exception
- Monitor job progress
- Get an estimated time remaining for a job
- Store additional data for a job monitoring
Installation
Configuration
Copy configuration & migration to your project:
Migrate the Queue Monitoring table. The table name can be configured in the config file or via the published migration.
Usage
To monitor a job, simply add the sbourdette\MongoQueueMonitor\Traits\IsMonitored
Trait.
Important! You need to implement the Illuminate\Contracts\Queue\ShouldQueue
interface to your job class. Otherwise, Laravel will not dispatch any events containing status information for monitoring the job.
UI
You can enable the optional UI routes by calling Route::queueMonitor()
inside your route file, similar to the official ui scaffolding.
Routes
Route | Action |
---|---|
/ |
Show the jobs table |
See the full configuration file for more information.
Extended usage
Progress
You can set a progress value (0-100) to get an estimation of a job progression.
Chunk progress
A common scenario for a job is iterating through large collections.
This example job loops through a large amount of users and updates it's progress value with each chunk iteration.
Progress cooldown
To avoid flooding the database with rapidly repeating update queries, you can set override the progressCooldown
method and specify a length in seconds to wait before each progress update is written to the database. Notice that cooldown will always be ignore for the values 0, 25, 50, 75 and 100.
Custom data
This package also allows setting custom data in array syntax on the monitoring model.
In order to show custom data on UI you need to add this line under config/queue-monitor.php
Only keep failed jobs
You can override the keepMonitorOnSuccess()
method to only store failed monitor entries of an executed job. This can be used if you only want to keep failed monitors for jobs that are frequently executed but worth to monitor. Alternatively you can use Laravel's built in failed_jobs
table.
Retrieve processed Jobs
Model Scopes
This package is a fork of romanzipp's laravel-queue-monitor
All versions of laravel-mongo-queue-monitor with dependencies
ext-json Version *
ext-mbstring Version *
jenssegers/mongodb Version ^3.8
illuminate/database Version ^7.30.3|^8.22.1
illuminate/queue Version ^7.30.3|^8.22.1
illuminate/support Version ^7.30.3|^8.22.1
nesbot/carbon Version ^2.0