Weave 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

Php Amqp Laravel Package

pdezwart/php-amqp

php-amqp is a PHP extension that wraps librabbitmq to provide AMQP 0-9-1 support, letting applications connect to RabbitMQ to publish and consume messages and manage queues and exchanges. It offers a fast, native alternative to pure-PHP AMQP libraries.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature: reliable background processing. Whether asynchronous jobs (emails, exports, image/video processing, third‑party sync) get a durable, retryable transport instead of a cron hack or fire‑and‑forget call.
  • Architecture / build‑vs‑buy. The real decision is "is AMQP (typically RabbitMQ) our messaging backbone?" This package is one of two client implementations of that decision. Buying the extension is cheaper than writing and maintaining a custom AMQP client; the trade is a native dependency in our runtime.
  • Roadmap: event‑driven / service decoupling. If the roadmap includes cross‑service events, fanout notifications, or migrating monolith modules into services, a broker client is a prerequisite, not a nice‑to‑have. Adopting it now de‑risks that roadmap item.
  • Cost and capacity planning. As a C extension over librabbitmq, it publishes/consumes with lower CPU and memory per message than a pure‑PHP client, and supports persistent connections and heartbeats in long‑running workers. That translates directly into worker fleet size and per‑message infra cost at volume.
  • Use‑case gating for specific features: delayed/retry jobs with backoff, priority queues, dead‑letter handling, publisher confirms for at‑least‑once delivery, and prefetch/QoS tuning for fair work distribution — all supported, all things product will eventually ask for ("why did the email send twice?" / "why is this job stuck?").
  • Vendor and platform constraints. Because it is a compiled extension, this decision constrains where we can deploy (managed PaaS, shared hosting, serverless). That is a product‑platform decision as much as an engineering one.

Worth flagging to stakeholders: the package itself is not Laravel‑aware. It ships no service provider, no queue driver, no config. Laravel has no native AMQP driver. So "adopt this" actually means "adopt this plus a queue‑driver package (e.g. vladimir-yuldashev/laravel-queue-rabbitmq, which can wrap either this extension or php-amqplib) or write a connector." Budget for that integration explicitly; it is the hidden line item.

When to Consider This Package

Adopt when:

  • We have committed to RabbitMQ or another AMQP 0‑9‑1 broker.
  • Message volume is high enough that client‑side CPU/memory and connection overhead show up in cost or latency.
  • We run long‑lived queue workers where persistent connections, heartbeats, and prefetch control matter.
  • We control the runtime — our own containers/VMs, able to build PHP images with php-dev, autoconf, and the extension compiled in.
  • We need the lower‑level primitives (exchanges, routing keys, confirms, QoS) rather than a simple push/pop abstraction.
  • Team is comfortable with native dependencies, PECL/pie builds, and PHP major‑version upgrade coupling.

Look elsewhere when:

  • We cannot install custom extensions — shared hosting, restricted managed PaaS, some serverless/container platforms. Fall back to pure‑PHP php-amqplib (same protocol, no build step).
  • Volume is modest and a database or Redis queue (with Horizon) already meets the SLO. Adding a broker adds an operational dependency for little gain.
  • The requirement is actually streaming or event log (Kafka, Kinesis) or cloud‑native pub/sub (SQS/SNS, Google Pub/Sub) — different semantics, different clients.
  • We need AMQP 1.0 — this is 0‑9‑1 only.
  • We need a non‑blocking/async client inside an event loop (amphp, ReactPHP, Swoole) — this API is synchronous and blocking; it fits the worker‑process model, not the async model.
  • Windows‑first or cross‑platform developer parity is a hard requirement.
  • License needs a check: the metadata reports NOASSERTION. The project is under the PHP License 3.01, which is permissive, but legal should confirm before it enters a distributed product. Treat this as a one‑day blocker, not a red flag.

Also note the maturity signal: ~584 stars and a modest opportunity score suggest a stable, unglamorous utility rather than an actively evolving package. That is fine for a protocol binding — but plan for the possibility that PHP‑version support lags on major releases, and keep the abstraction boundary thin enough to swap clients.

How to Pitch It (Stakeholders)

For executives (one paragraph): We are evaluating the standard PHP client for AMQP — the protocol behind RabbitMQ — to underpin background job processing and, later, service‑to‑service events. It is plumbing, not a feature: no user‑visible surface, but it is the difference between jobs that retry safely and jobs that silently vanish. The business case is reliability plus per‑message infrastructure cost at scale, and it is a prerequisite for the event‑driven items on the roadmap. Cost is engineering time to add a compiled extension to our images and to wire a Laravel queue driver, plus a short legal review of the license. Risk is concentration: it becomes a dependency of our deployment platform, so we would adopt it behind an internal interface that lets us swap to a pure‑PHP client without touching product code.

For engineering (the honest version): This is the C extension binding to librabbitmq — AMQPConnection / AMQPChannel / AMQPExchange / AMQPQueue, synchronous and blocking, so it fits our prefork/worker model and not an event loop. Upside versus php-amqplib: lower CPU and memory per message, persistent connections with heartbeats, native publisher confirms and QoS. Downside: it is a build‑time dependency — every image needs the extension, and we inherit coupling to PHP minor/major upgrades and to the extension's release cadence. It gives us nothing Laravel‑specific; we still need a queue driver package or our own connector. Recommendation if approved: wrap it behind a QueueClient interface with php-amqplib as the fallback implementation, so the extension is an optimization rather than a lock‑in.

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.
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator