bernardosecades/queue-system-bundle
queue:work, queue:listen), offering a lightweight alternative to Laravel’s native queue drivers (database, sync, etc.).AppServiceProvider/ServiceProvider).Queue::connection('images')).ShouldQueue interfaces or custom job classes.dev-master.retry-after vs. Redis TTL).Illuminate\Contracts\Queue\Job implementations?failed_jobs table vs. Redis lists)?queue:failed-table or queue:prune?spatie/laravel-queue-redis or laravel/framework’s native Redis queue suffice?composer require but requires Laravel-specific bootstrapping (e.g., register() in AppServiceProvider).Queue facade or injected into jobs.ShouldQueue or wrap bundle-specific job classes.queue:redis) if no custom queue logic is needed.spatie/laravel-queue-redis for Laravel-specific Redis queue features.afterCommit, delay).dev-master).config/app.php (Laravel 5.5+) or AppServiceProvider.config/queue_system.yml (or merge with Laravel’s config/queue.php).class ProcessImage implements ShouldQueue {
use Dispatchable, InteractsWithQueue;
public $queue = 'images'; // Maps to config/queue_system.yml
public function handle() { ... }
}
queue:work commands or supervisor configs to use the new queue.Illuminate\Contracts\Queue\Queue. A facade or service wrapper is needed to bridge Laravel’s Queue facade.// AppServiceProvider.php
public function register() {
$this->app->bind('queue.images', function () {
return $this->app->make('bernardo.secades.queue_system')->getQueue('images');
});
}
queue_system:
serializer: 'laravel' # Hypothetical; may require bundle patching.
retry-after may not map cleanly to Redis TTL. Custom middleware may be needed.queue:work with bundle-specific workers (if applicable).dev-master dependency risks breaking changes. Pin to a commit hash or fork.jms/serializer). Conflicts may arise with Laravel’s dependencies.redis-cli monitor, redis-cli BRPOP).queue:failed, Horizon).failed_jobs table. Custom logic needed to:
// Custom failed job handler
$this->app->afterResolving('bernardo.secades.queue_system', function ($queueSystem) {
$queueSystem->onJobFailed(function ($job, $exception) {
\DB::table('failed_jobs')->insert([...]);
});
});
queue:work processes).redis-cli info memory.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Redis server down | All queued jobs stall. | Use Laravel’s queue:retry or fallback to database queue. |
| Bundle bug (e.g., job deserialization) | Jobs fail silently or corrupt data. | Implement job validation layers; log raw payloads for debugging. |
| Configuration mismatch | Jobs dispatched to wrong queues or fail to serialize. | Use environment variables for critical settings (e.g., Redis URL). |
| Dependency conflicts | Symfony/Laravel version mismatches break functionality. | Isolate bundle in a separate Composer package or container. |
| No job retries | Failed jobs are lost. | Implement custom retry logic using Laravel’s retryAfter or cron-based polling. |
How can I help you explore Laravel packages today?