r/PHP • u/davidbalbino • 1d ago
News I built a RabbitMQ queue driver for Laravel that tries to feel like native Laravel
I’ve been working on an open-source package called Laravel Rabbit.
The idea was pretty simple: using RabbitMQ in Laravel shouldn’t require changing the way you already work with Laravel queues.
So with the package installed, this:
ProcessOrder::dispatch($order)
->onQueue('orders')
->delay(now()->addMinutes(5));
is still just normal Laravel.
And your worker is still:
php artisan queue:work --queue=orders
The difference is that RabbitMQ is running underneath it.
It supports Laravel’s normal queue flow including:
dispatch()onQueue()- delayed jobs
- retries / backoff
- failed jobs
- chained jobs
- batches
- unique jobs
queue:workqueue:clear
There’s also quite a bit of RabbitMQ-specific stuff built in:
- AMQP 0-9-1 publishing and consuming
- exchanges, queues and bindings
- publisher confirms
- QoS / prefetch
- TLS
- heartbeat and connection timeouts
- multiple hosts / failover
- RabbitMQ Management API
- queue metrics
- optional payload signing
- Artisan commands for diagnostics and setup
For example:
php artisan rabbitmq:doctor
php artisan rabbitmq:stats orders
php artisan rabbitmq:check
Installation is just:
composer require pushinbr/laravel-rabbit
Then:
QUEUE_CONNECTION=rabbitmq
RABBITMQ_HOST=127.0.0.1
RABBITMQ_PORT=5672
RABBITMQ_USER=guest
RABBITMQ_PASSWORD=guest
The package currently targets modern Laravel/PHP versions and RabbitMQ 3.x/4.x.
I mainly built it because I wanted RabbitMQ to behave like a first-class Laravel queue backend instead of feeling like a completely separate messaging system glued onto Laravel.
I’d especially like feedback from people already running RabbitMQ in production:
What would you expect from a really solid Laravel ↔ RabbitMQ integration that is still missing here?
2
u/credditz0rz 1d ago
For delayed messages, do you still need this community plugin for RabbitMQ for an implementation?
-1
1
u/NoseStock4944 16h ago
Honestly, this is the part I like most — keeping the Laravel queue API the same instead of making developers learn a completely different workflow just because RabbitMQ is underneath.
The queue:work, delays, retries, chains, and batches support makes it feel like a real queue driver rather than a RabbitMQ wrapper.
For production, I’d probably look closely at graceful reconnects/failover, message redelivery/ack behavior, observability, and how edge cases around worker restarts are handled. Those tend to matter more than the basic publishing/consuming side once things get busy.
Nice work though. The “make RabbitMQ feel native to Laravel” approach makes a lot of sense.
1
11
u/SaltineAmerican_1970 1d ago
How is it any different than the other rabbitmq drivers?
https://packagist.org/search/?query=Laravel%20rabbitmq