enqueue/amqp-tools
Extends AMQP transports with features beyond the spec, compatible with any amqp interop transport. Part of the Enqueue PHP messaging ecosystem for building reliable, interoperable message queues.
Architecture fit. enqueue/amqp-tools is a capability layer, not a queue driver. It ships the things AMQP 0-9-1 leaves to the broker or the app: delayed/expiring messages, priority handling, retry/backoff strategies, reply-to RPC helpers, and message attribute serialization utilities. It sits inside the php-enqueue stack as transport (amqp-ext or amqp-lib) → queue-interop/amqp-interop spec → amqp-tools (extras) → framework bridge. That means adopting it is really a decision to accept the queue-interop abstraction, not a drop-in for Laravel's Queue facade. It fits well where the backlog needs per-message delay, priority tiers, or cross-language consumers speaking a documented envelope; it is over-engineering where a Laravel driver plus SQS/Redis already clears the requirement.
Integration feasibility. Feasible, but the seam is real work. There is no first-party Laravel queue driver in this package: either you write an Illuminate\Queue\QueueManager extension (a custom Queue + Job implementation, roughly 300–600 LOC with tests), or you adopt a community bridge (enqueue/laravel-queue), which has historically lagged Laravel majors — verify against the exact Laravel version in the target app before committing to it in a plan. The cheaper alternative worth evaluating in the same spike: keep Laravel's native queue driver, and only use amqp-tools in a small number of services that genuinely need delayed/priority messaging.
Technical risk.
| Risk | Why it matters | Mitigation |
|---|---|---|
| Single-vendor stewardship (Forma-Pro), community-only support | Bus factor, no SLA, roadmap outside your control | Pin versions; vendor code lives in one monorepo (split-published), so audit the split package, not enqueue-dev |
| "DEVELOPMENT REPOSITORY" banner and monorepo layout | Procurement/security review will flag it; distorts "0 dependents" data | Document that enqueue/amqp-tools is a split-package release; cite Packagist download stats instead |
| Feature dependence on broker plugins | Per-message delay usually requires rabbitmq_delayed_message_exchange; managed brokers (Amazon MQ, some CloudAMQP tiers) may forbid it |
Confirm plugin availability before designing; otherwise fall back to TTL+DLX, which loses exact delay |
| Interop abstraction lock-in | Business logic written against interop interfaces is portable; against enqueue transport objects it is not | Own thin MessagePublisher/MessageConsumer ports in your domain layer |
| At-least-once semantics assumed to be exactly-once | Duplicate delivery causes double charges, double emails | Make idempotency an acceptance criterion for every queued job |
| Upgrade churn on Laravel majors | The bridge, not the broker, is the usual breakage point | Put an upgrade test in CI now, not after go-live |
Key questions for the TPM to force answers on.
Stack fit. PHP 8.1+ with either ext-amqp (fastest, requires the C extension in every image) or php-amqplib (pure PHP, simpler deploys, slower). It coexists with existing Laravel drivers at per-connection granularity, so there is no all-or-nothing cutover: Redis/database queues keep running for jobs that do not benefit.
Migration path (phased, gated).
amqp connection; all other queues untouched. Success criteria: zero message loss over a week, DLQ triage documented.Compatibility checkpoints.
| Component | Check before committing |
|---|---|
| Laravel version | Bridge package supports it, or you are writing the driver — price both |
| PHP runtime | ext-amqp present in every container/FPM image, or accept php-amqplib throughput |
| Broker | RabbitMQ 3.8+ for AMQP 0-9-1; confirm version, plugin policy, quorum-queue support |
| Message format | JSON envelope with version field if any non-PHP consumer exists; serialize() only in a closed PHP world |
| Managed broker | Amazon MQ / CloudAMQP feature matrix vs. the tools you intend to use |
Sequencing. Topology-as-code first (exchanges, queues, bindings, DLX, retry tiers at 5s/1m/10m), then Laravel connection config, then worker command with prefetch, graceful shutdown, and supervisor/systemd wiring, then observability (queue depth, ack/nack rate, age of oldest message), then finally the dispatch path. Retrofitting dead-letter queues after a message-loss incident costs an order of magnitude more than doing it in week one.
Maintenance. Three surfaces, and the TPM should budget for all three: (a) the vendor package and its Laravel bridge, which breaks on framework majors; (b) broker operations — patching, plugin upgrades, topology drift, quorum-queue migration; (c) your own glue — driver, serialization contract, worker supervision. Realistically a recurring fraction of an engineer, spiking at every Laravel upgrade.
Support. Community Gitter and GitHub issues, no SLA, no LTS branch. The README explicitly solicits commercial engagement with Forma-Pro; if AMQP becomes revenue-critical, that is a legitimate budget line to open before the incident, not during it.
Scaling. Throughput is dominated by prefetch/QoS tuning and consumer count, not by this package. Watch for: priority queues reducing raw throughput, delayed-message plugin overhead at volume, AMQP connection exhaustion when publishing from PHP-FPM (use a shared connection or a relay), and long-running workers leaking memory across jobs. Make sure autoscaling keys off backlog age and depth, not CPU — queue workers are idle-waiting by nature and CPU-based scaling will under-provision at exactly the wrong moment.
Failure modes.
| Mode | Symptom | Pre-planned response |
|---|---|---|
| Broker unavailable | Synchronous publishes block web requests | Publish timeouts, circuit breaker, fallback driver or local buffer |
| Poison message | One queue stalls, depth climbs | DLX + retry tiers + a documented replay procedure |
| Consumer crash mid-job | At-least-once redelivery | Idempotent handlers; assert this in code review |
| Missing delay plugin | Delays silently become immediate | Detect at boot and fail loudly, do not degrade quietly |
| Schema drift producer/consumer | Decode errors downstream | Versioned envelope, consumer contract tests |
| Unacked connection drop | Message loss if not persistent/durable | Durable queues, persistent messages, publisher confirms |
Ramp-up. Assume 3–6 weeks before a PHP team new to AMQP is independently productive. Competencies: exchange/binding topology, at-least-once semantics and idempotency, prefetch tuning, DLQ triage, and monitoring. Accelerators worth funding up front: a reference job template, an operational runbook, and one recurring drill — "pick a message ID and prove where it went." Teams that can answer that under pressure are ready for production; teams that cannot are not.
TPM recommendation. Proceed only if the spike demonstrates one specific unmet capability (per-message delay, priority routing, or a documented cross-language contract) that the incumbent Laravel driver cannot deliver, and only if the broker is under your control or contractually permits the required plugins. Otherwise, use Laravel's native queue on SQS or Redis and revisit this package when the event-driven surface actually arrives.
How can I help you explore Laravel packages today?