Download the PHP package jeffersongoncalves/laravel-queue-consumer without Composer
On this page you can find all versions of the php package jeffersongoncalves/laravel-queue-consumer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeffersongoncalves/laravel-queue-consumer
More information about jeffersongoncalves/laravel-queue-consumer
Files in jeffersongoncalves/laravel-queue-consumer
Package laravel-queue-consumer
Short Description Dispatch Laravel queue jobs from ephemeral review environments to a central hub over HTTP instead of running a local queue worker.
License MIT
Homepage https://github.com/jeffersongoncalves/laravel-queue-consumer
Informations about the package laravel-queue-consumer
Laravel Queue Consumer
Dispatch Laravel queue jobs to a central "hub" application over HTTP, instead of running a dedicated queue worker in every environment.
This package is built for setups that spin up an ephemeral Laravel application per git branch (review apps) for CI. Running a full queue worker in each of these short-lived environments wastes memory across dozens of environments that are mostly idle. laravel-queue-consumer lets each environment forward its queued jobs, over HTTP, to a shared hub application that actually executes them.
How it works
This package is the producer side of the protocol only. It registers a hub queue connection: once selected via QUEUE_CONNECTION=hub, every dispatch() call in your application is serialized exactly like Laravel would for any other driver, then POSTed to your hub's /api/jobs endpoint. Nothing is executed locally.
A separate package, laravel-queue-worker (not yet published), is the hub-side consumer: it receives these HTTP requests and executes the job payloads using the Artisan command this package ships (queue-consumer:run). Without a hub application running that package, jobs dispatched through this connection are never executed — this package alone does not run your jobs.
Installation
You can install the package via composer:
The package uses Laravel's auto-discovery, so the service provider is registered automatically.
Publish Configuration
This publishes config/queue-consumer.php:
Environment Setup
Add the following to your .env and switch your application's queue connection to hub:
QUEUE_CONSUMER_SLUG is optional and defaults to basename(base_path()) — the folder name of the current environment (e.g. app-feature-1234). No changes are required at any dispatch() call site; every job your application already dispatches will be forwarded to the hub as soon as QUEUE_CONNECTION=hub is set.
Protocol
Every job is forwarded as a POST request to {hub_url}/api/jobs:
The request carries an X-Laravel-Queue-Token header with the configured token. A successful hub response is 202 with {"id": "<hub job id>"}. Delivery is at-least-once — dedup is expected to happen hub-side.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
This package must only be used to talk to a trusted internal hub application. Never point hub_url at an untrusted or public host — the token grants whoever holds it the ability to have arbitrary serialized job payloads executed on the hub. Please review our security policy on how to report security vulnerabilities.
Limitations
- No local execution fallback: if the hub is unreachable, the job dispatch fails loudly (except for a small number of automatic retries on connection failure) — there is no local queue to fall back to.
- No supervisor process, no cron scheduling, and no retry policy beyond the thin connection-retry in the HTTP push are included.
- Designed for ephemeral review environments, not for production traffic.
Credits
- Jefferson Gonçalves
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-queue-consumer with dependencies
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/queue Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
spatie/laravel-package-tools Version ^1.14.0