- What is iamfarhad/laravel-rabbitmq and when should I use it?
- It is a native ext-amqp RabbitMQ queue driver that plugs directly into Laravel's queue system, so dispatch(), delay(), and onQueue() keep working unchanged. It is aimed at teams that control their own infrastructure and want native RabbitMQ performance for long-running workers, connection and channel pooling, publisher confirms, quorum queues, and Horizon or Octane support. For low-throughput apps or environments where you cannot install PHP extensions, it is likely more operational overhead than you need.
- How do I install and configure iamfarhad/laravel-rabbitmq in a Laravel app?
- Install the package with Composer and make sure the native ext-amqp extension is available in your PHP runtime, which on Linux typically means installing librabbitmq-dev and building the extension through PECL. Then switch your queue connection by setting QUEUE_CONNECTION=rabbitmq in .env and publishing or editing config/queue.php for hosts, exchanges, and routing keys. Existing App\Jobs classes do not need modification unless you want to use raw RabbitMQ message features.
- Which Laravel, PHP, and RabbitMQ versions does this package support?
- The package supports Laravel 10 through 13 and requires PHP 8.2 or newer for ext-amqp compatibility and modern Laravel features. RabbitMQ 3.13 and 4.x are the primary supported broker versions, while 3.8 through 3.12 are handled on a best-effort basis. Check the SUPPORT.md compatibility matrix in the repository before upgrading either Laravel or your RabbitMQ cluster.
- Why does this package require ext-amqp instead of php-amqplib?
- It is intentionally built on the native ext-amqp extension for performance, connection and channel pooling, publisher confirms, and long-running worker efficiency. There is no php-amqplib fallback, so environments without ext-amqp, such as some shared hosts or slim Docker images, will not work until the extension is installed. This is a deliberate trade-off that favors teams controlling their production runtime over Composer-only portability.
- How does iamfarhad/laravel-rabbitmq integrate with Laravel Horizon?
- Horizon support is optional and opt-in, and when enabled it lets Horizon monitor and manage RabbitMQ-backed workers alongside your other queues. You typically need to set RABBITMQ_WORKER=horizon so the package hands worker supervision to Horizon correctly. If Horizon is not already part of your stack, evaluate whether the added configuration complexity is justified for your workload.
- Is this RabbitMQ driver safe to use with Laravel Octane?
- Yes, the package includes Octane-safe pool reset support so AMQP connections and channels are not reused incorrectly across requests. You can control this behavior with RABBITMQ_OCTANE_RESET_ON_REQUEST, and setting it to true resets the pool on each request for maximum isolation. Tune this alongside your pooling settings, since resetting on every request trades some performance for safety.
- How are delayed messages and quorum queues configured?
- Delayed messages rely on either TTL plus dead-letter routing or the RabbitMQ delayed-message plugin, so availability depends on your broker setup. Quorum queues, lazy queues, priority queues, and dead-letter routing are enabled through .env values or config/queue.php rather than code changes. Confirm that your RabbitMQ version and cluster policy support the queue type you plan to declare.
- What is the difference between poll mode and consume mode workers?
- Poll mode is pull-based and aligns with Laravel's default worker behavior, making it the safer, more familiar choice for most deployments. The optional consume mode uses basic_consume for high-performance push-based delivery but requires more careful scaling, typically one queue per worker process. Use consume mode only when you can tune worker supervision with Supervisor, systemd, or Kubernetes.
- How does it compare with vladimir-yuldashev/laravel-queue-rabbitmq?
- The main difference is that this package is built on native ext-amqp, while vladimir-yuldashev/laravel-queue-rabbitmq uses php-amqplib and installs with Composer alone. That gives this driver connection and channel pooling, publisher confirms, and lower overhead for long-running workers, at the cost of requiring the PHP extension. The repository includes a detailed comparison document to help you choose based on your deployment constraints.
- How do I manage queues and monitor connection pools in production?
- The package ships Artisan commands such as rabbitmq:queue-declare, rabbitmq:queue-purge, rabbitmq:queue-delete, and rabbitmq:pool-stats for day-to-day operations. Use these alongside your normal RabbitMQ monitoring for dead-letter queues, failed-message rerouting, and multi-host failover health. For production, plan who owns cluster backups, alerts, and reprocessing of failed messages before you cut over from the database driver.