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 Lib Laravel Package

enqueue/amqp-lib

AMQP transport for Enqueue implementing amqp-interop on top of php-amqplib. Connect to RabbitMQ/AMQP brokers to publish and consume messages, with links to docs, support, and issue tracking. MIT licensed.

View on GitHub
Deep Wiki
Context7

enqueue/amqp-lib provides an AMQP transport for the Enqueue ecosystem, implementing the amqp-interop specification on top of php-amqplib. It offers a consistent messaging API for working with brokers like RabbitMQ while staying compatible with the Queue Interop standards.

Use it to integrate reliable message publishing and consuming into your PHP applications with a transport focused on interoperability and maintainability.

  • Implements amqp-interop for standardized AMQP messaging
  • Built on php-amqplib for proven protocol support
  • Designed for use with the Enqueue messaging stack
  • Clear docs and resources for setup and troubleshooting
  • MIT licensed and community supported
Frequently asked questions about Amqp Lib
How do I integrate enqueue/amqp-lib with Laravel’s queue system?
Use the **enqueue/laravel** bridge to connect Enqueue to Laravel’s queue system. Configure the AMQP transport in `config/queue.php` under the `connections` array, specifying the `amqp-lib` transport and a valid AMQP DSN (e.g., `amqp://user:pass@rabbitmq:5672/%2f`). Ensure your Laravel jobs are serializable, as AMQP requires this for message passing.
Which Laravel versions are compatible with enqueue/amqp-lib?
The package works with **Laravel 8.x, 9.x, and 10.x** via the Enqueue bridge. For older versions (7.x), check the Enqueue documentation for compatibility notes. The transport itself is framework-agnostic but relies on Enqueue’s Laravel integration, which handles version-specific quirks.
Can I use enqueue/amqp-lib without Laravel (standalone PHP)?
Yes. The package is part of the **Enqueue ecosystem** and can be used independently for AMQP-based messaging (e.g., pub/sub, RPC). Install via Composer (`enqueue/amqp-lib`) and configure it in an Enqueue context. Example use cases include microservices or custom event-driven workflows outside Laravel.
What AMQP brokers does enqueue/amqp-lib support?
It primarily supports **RabbitMQ** (most tested) and other **AMQP 0-9-1 compliant brokers** like Qpid or Apache Qpid Dispatch. For brokers with non-standard extensions (e.g., RabbitMQ’s federation), consult the [php-amqplib docs](https://github.com/php-amqplib/php-amqplib) for compatibility. SSL/TLS and authentication (e.g., SASL) are configurable.
How do I handle message retries or dead-letter queues in Laravel with AMQP?
Leverage Enqueue’s **retry mechanism** and Laravel’s built-in retry logic. Configure the `options` array in your queue connection to include `retry_strategy` (e.g., `max_attempts`). For dead-letter queues, use RabbitMQ’s native dead-letter exchange or Enqueue’s `dead_letter_exchange` option in the transport configuration.
Is enqueue/amqp-lib production-ready? Any known stability issues?
Yes, it’s production-ready and widely used in high-traffic systems. However, monitor **connection timeouts** (tune `connection_timeout` in DSN) and **prefetch counts** (set via `options['prefetch_count']`) to avoid consumer overload. Test failover scenarios if using clustered brokers, as AMQP connections are stateful.
How does enqueue/amqp-lib compare to Laravel’s built-in Redis/SQL queue drivers?
Unlike Redis/SQL drivers, AMQP offers **pub/sub, RPC, and advanced routing** (exchanges/bindings) for complex workflows. It’s better for **distributed systems** but adds network latency. For simple job queues, Redis/SQL may suffice; AMQP shines in **event-driven architectures** or when integrating with other AMQP-based services.
Can I monitor AMQP queue metrics (e.g., message depth, consumer lag) in Laravel?
Yes, use **RabbitMQ’s Management Plugin** (HTTP API) or tools like **Prometheus + Grafana** with the `rabbitmq_exporter`. For Laravel-specific metrics, extend Enqueue’s context to log queue stats or integrate with monitoring libraries like `spatie/laravel-monitoring`. The transport itself doesn’t include built-in metrics but exposes AMQP’s native stats.
What’s the performance overhead of AMQP vs. in-memory queues (e.g., sync) in Laravel?
AMQP introduces **network latency** (10–100ms per message, depending on broker distance) compared to in-memory queues (microseconds). For high-throughput systems, optimize with **connection pooling** (php-amqplib’s `persistent_connections`) and **batch processing**. Benchmark with tools like `ab` or `k6` to compare against Redis/SQL drivers.
How do I debug connection issues or message loss in enqueue/amqp-lib?
Enable **debug logging** in php-amqplib via `options['log_level'] = LOG_DEBUG`. Check RabbitMQ logs for broker-side errors. Use Enqueue’s `Context` to inspect message flow. For message loss, verify **persistence settings** (AMQP messages must be durable/non-transient) and **consumer acknowledgments** (set `acknowledge_mode` to `manual` if needed).
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
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
twbs/bootstrap4