https://github.com/softonic/laravel-queue-job
Custom Job implementation for vyuldashev@laravel-queue-rabbitmq library
https://github.com/softonic/laravel-queue-job
Last synced: about 1 year ago
JSON representation
Custom Job implementation for vyuldashev@laravel-queue-rabbitmq library
- Host: GitHub
- URL: https://github.com/softonic/laravel-queue-job
- Owner: softonic
- License: other
- Created: 2021-12-08T10:48:23.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-20T14:25:50.000Z (over 2 years ago)
- Last Synced: 2024-04-15T09:21:21.277Z (about 2 years ago)
- Language: PHP
- Size: 11.7 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
Laravel Queue Job
====================
[](https://github.com/softonic/laravel-queue-job/releases)
[](LICENSE.md)
[](https://travis-ci.org/softonic/glaravel-queue-job)
[](https://packagist.org/packages/softonic/laravel-queue-job)
[](http://isitmaintained.com/project/softonic/laravel-queue-job "Average time to resolve an issue")
[](http://isitmaintained.com/project/softonic/laravel-queue-job "Percentage of issues still open")
Custom Job implementation for [vyuldashev/laravel-queue-rabbitmq](https://github.com/vyuldashev/laravel-queue-rabbitmq) library
:warning: This library works on [vyuldashev/laravel-queue-rabbitmq](https://github.com/vyuldashev/laravel-queue-rabbitmq).
If you have questions about how to configure connections, feel free to read the [vyuldashev/laravel-queue-rabbitmq](https://github.com/vyuldashev/laravel-queue-rabbitmq) documentation.
Main features
-------------
* Add support to have multiple Handlers for the same Routing key.
* Assign your Routing keys with your Handlers in the queue config file.
Installation
-------------
You can require the last version of the package using composer
```bash
composer require softonic/laravel-queue-job
```
Usage
-------------
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',
// ...
],
// ...
],
```
Testing with artisan
-------
Your
``
php artisan queue:work {connection-name} --queue={queue-name}
``
Testing
-------
`softonic/laravel-queue-job` has a [PHPUnit](https://phpunit.de) test suite, and a coding style compliance test suite using [PHP CS Fixer](http://cs.sensiolabs.org/).
To run the tests, run the following command from the project folder.
``` bash
$ docker compose run test
```
To open a terminal in the dev environment:
``` bash
$ docker compose run --entrypoint=bash php
```
License
-------
The Apache 2.0 license. Please see [LICENSE](LICENSE) for more information.