brajmohan / laravel-job-runner-over-http
Exposes all Laravel jobs over an HTTP endpoint
Fund package maintenance!
brajmohan
Requires
- php: ^7.3|^7.4|^8.0
- ext-json: *
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-09-25 15:40:24 UTC
README
This package provides an POST endpoint. To which a job in the following format can be posted and this will run that Job.
{ "connection": "queue-connection-name", "queue": "queue-name", "payload": "job-payload" }
Parameter connection
and queue
is ignored if laravel's native job is provided in the payload.
Wonder why this package? Laravel artisan job runner is quite shaky specially in push mode (ActiveMQ/RabbitMQ). It loses connection, crashes without any trace. So if you want to transfer the responsibility of running jobs to a different language without rewriting your entire worker codebase. You can just expose these Jobs over an HTTP endpoint and then you are free to use any method of fetching the jobs from the store and firing them over this endpoint.
Installation
You can install the package via composer:
composer require brajmohan/laravel-job-runner-over-http
You can publish the routes with:
php artisan vendor:publish --provider="BrajMohan\LaravelJobRunnerOverHttp\LaravelJobRunnerOverHttpServiceProvider" --tag="laravel-job-runner-over-http-migrations"
Important: Don't forget to add the published routes file in your RouteServiceProvider
Usage
It works out of the box. There is nothing you need to do apart from installing this package. You can customize the route it exposes by publishing the routes file as described above.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.