Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Amqp Ext Laravel Package

enqueue/amqp-ext

AMQP transport for Enqueue implementing amqp-interop using the PHP amqp extension. Connect Enqueue to RabbitMQ/AMQP brokers with a native extension-based driver. Documentation and support links included.

View on GitHub
Deep Wiki
Context7

enqueue/amqp-ext provides an AMQP transport for the Enqueue ecosystem, implementing the amqp-interop interfaces on top of the native PHP amqp extension. It’s designed to integrate cleanly into existing Enqueue-based message-driven applications while leveraging the performance and features of the underlying extension.

Use it to connect producers and consumers to AMQP brokers (e.g., RabbitMQ) with a consistent interop API and Enqueue tooling.

  • amqp-interop compliant transport implementation
  • Built on the PHP amqp extension for low-level AMQP support
  • Fits into the broader Enqueue messaging stack and workflows
  • Actively maintained with CI and published via Packagist
Frequently asked questions about Amqp Ext
How do I replace Laravel’s default queue driver with enqueue/amqp-ext for RabbitMQ?
Install the enqueue/laravel package and configure your `config/queue.php` to use the AMQP transport. Set the `driver` to `enqueue` and provide a DSN like `amqp://user:pass@rabbitmq:5672/%2f`. Ensure the `ext-amqp` PHP extension is installed via PECL. No additional code changes are needed for basic usage.
What Laravel versions and PHP requirements does enqueue/amqp-ext support?
This package supports Laravel 10+ and requires PHP 8.1+. The underlying `ext-amqp` extension must be installed (v1.9.3 or v2.0.0). Check compatibility with your Laravel runtime by verifying the extension is loaded via `php -m | grep amqp`.
Can I use enqueue/amqp-ext for standalone AMQP tasks without Laravel’s queue system?
Yes. Use the `AmqpConnectionFactory` class to create direct AMQP connections. This is ideal for cross-service communication or event-driven workflows outside Laravel’s queue system. Example: Inject the factory into a service and publish messages to RabbitMQ without queue workers.
How does enqueue/amqp-ext handle message persistence and reliability compared to Laravel’s database queue?
AMQP brokers like RabbitMQ persist messages to disk by default, offering better reliability than Laravel’s database queue for high-throughput workloads. However, you must configure acknowledgments (`ack`) and prefetch counts to manage consumer reliability. Use `enqueue/amqp-tools` for retry logic and dead-letter queues.
What are the performance benefits of using the PHP amqp extension over other Enqueue transports?
The native `ext-amqp` extension provides lower-latency communication with RabbitMQ compared to HTTP-based transports (e.g., enqueue/amqp-lib). It’s optimized for high-throughput scenarios like video processing or real-time event sourcing, but requires the extension to be installed system-wide.
How do I configure custom AMQP exchanges, bindings, or QoS settings with enqueue/amqp-ext?
Use the `AmqpContext` class to define custom configurations, such as exchange types (direct, topic), bindings, or QoS settings like prefetch counts. Example: `$context = new AmqpContext(['exchange' => ['name' => 'my_exchange', 'type' => 'topic']]);`. Pass this to your connection factory for advanced routing.
Are there alternatives to enqueue/amqp-ext for Laravel AMQP integration?
Yes. Alternatives include `php-amqplib` (pure PHP, no extension) or `vladimir-yuldashev/laravel-queue-rabbitmq` (Laravel-specific). However, `enqueue/amqp-ext` offers better performance via the native extension and full `amqp-interop` compliance, making it ideal for production-grade async workflows.
How do I monitor message latency or consumer lag when using enqueue/amqp-ext?
Use RabbitMQ’s management plugin for metrics like message rates, consumer lag, and broker health. For Laravel, integrate tools like `enqueue/amqp-tools` for inspection or add custom health checks via Laravel’s `Artisan` commands. Monitor prefetch counts and QoS settings to avoid bottlenecks.
What’s the best way to handle AMQP broker downtime or connection failures?
Implement circuit breakers or local retries using `enqueue/amqp-tools`. Configure dead-letter exchanges to route failed messages for later reprocessing. For Laravel, use the `failed` queue table or custom logic to handle transient failures gracefully.
Does enqueue/amqp-ext support delayed messages or message TTL (time-to-live)?
Yes. Configure delayed messages via RabbitMQ’s `x-dead-letter-exchange` or use the `AmqpContext` to set TTL headers. Example: `$message->setDelay(60000)` for a 1-minute delay. Ensure your broker supports these features (RabbitMQ does by default).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport