Prevent duplicate jobs in Laravel php framework.
Warning This package is in its early stage and may have some edge case left.
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.
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.
Install and forget it.
You can keep this package enabled even for sync
queue connection.
Please see CHANGELOG for more information what has changed recently.
composer test
If you discover any security issue, please email pro.ankurk1[at]gmail[dot]com
instead of using the issue tracker.
This package is licensed under MIT License.