Custom Job implementation for vyuldashev/laravel-queue-rabbitmq library
- Add support to have multiple Handlers for the same Routing key.
- Assign your Routing keys with your Handlers in the queue config file.
You can require the last version of the package using composer
composer require softonic/laravel-queue-job
Replace your RabbitMQJob class in the queue config file.
'connections' => [
// ...
'rabbitmq' => [
// ...
'options' => [
'queue' => [
// ...
'job' => \Softonic\LaravelQueueJob\RabbitMQJob::class,
],
],
],
// ...
],
Add your message_handlers mapping in queue config file:
'message_handlers' => [
TestHandler::class => [ // Handler
'#.test_v1.created.testevent', // Routing keys
'#.test_v1.replaced.testevent',
'#.test_v1.updated.testevent',
'global.test_v1.updated.testevent',
// ...
],
AnotherTestHandler::class => [
'#.test_v1.created.testevent',
'global.test_v1.updated.testevent',
// ...
],
// ...
],
Your
php artisan queue:work {connection-name} --queue={queue-name}
softonic/laravel-queue-job
has a PHPUnit test suite, and a coding style compliance test suite using PHP CS Fixer.
To run the tests, run the following command from the project folder.
$ make tests
To open a terminal in the dev environment:
$ make debug
The Apache 2.0 license. Please see LICENSE for more information.