ankurk91 / laravel-dedupe-queue
Prevent duplicate jobs from running in Laravel php framework
Installs: 7 575
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- illuminate/bus: ^9.34 || ^10.0
- illuminate/cache: ^9.34 || ^10.0
- illuminate/log: ^9.34 || ^10.0
- illuminate/support: ^9.34 || ^10.0
Requires (Dev)
- orchestra/testbench: ^7.12 || ^8.0
- phpunit/phpunit: ^9.5
README
Deduplicate Queues for Laravel
Prevent duplicate jobs in Laravel php framework.
Warning This package is in its early stage and may have some edge case left.
Why and How?
Laravel does not prevent duplicate jobs in AWS SQS Standard Queue.
This package takes advantage of the UUID
assigned to each of the job pushed to the queue.
The UUID of the job does not get changed if the same message appears again in SQS queue.
This package injects a global middleware to all Jobs, Mailables, Notifications and Listeners; which keep tracks of incoming jobs and discards any duplicates by checking the UUID.
Installation
You can install the package via composer:
composer require "ankurk91/laravel-dedupe-queue"
The service provider will automatically register itself.
Optionally, You can publish the config file by:
php artisan vendor:publish --provider="Ankurk91\DedupeQueue\DedupeQueueServiceProvider"
Note It is suggested to use Redis, Memcached or DynamoDB for faster Atomic Locks.
Usage
Install and forget it.
You can keep this package enabled even for sync
queue connection.
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
composer test
Security
If you discover any security issue, please email pro.ankurk1[at]gmail[dot]com
instead of using the issue tracker.
License
This package is licensed under MIT License.