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

Module Amqp Laravel Package

codeception/module-amqp

Codeception module for testing AMQP messaging, usually RabbitMQ, in PHP. Adds helpers to declare queues and exchanges, publish messages, and grab or consume them in tests so you can verify message flows alongside your application code.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

What it is. codeception/module-amqp is the official Codeception helper module that exposes AMQP broker state to Codeception test suites. It wraps php-amqplib and surfaces assertions such as seeQueueIsEmpty, seeMessageInQueue, seeMessageInQueueCount, purgeQueue, scheduleMessage, and grabMessageFromQueue directly inside Cept/Cest test classes. It is a test-harness dependency: it never ships to production and carries no runtime surface in the application.

Architecture fit. Fit is binary and decided entirely by one question — is our test suite Codeception-based? If yes, this module is the canonical, idiomatic way to assert on RabbitMQ state and slots cleanly into the .suite.yml config model. If the estate is PHPUnit/Pest-first, the module is not usable at all; teams would instead pull php-amqplib in as a dev dependency and write a trait or custom assertion helper, which is roughly 100–200 lines of work.

Signal interpretation. The alarming-looking metrics (4 stars, 0 dependents) are misleading and should be read carefully. Codeception's helper modules were split out of the codeception/codeception monorepo around 2020, so they live in the org namespace as thin satellite packages rather than as standalone OSS projects. Stars and dependents are low because nobody adds a test helper as a transitive dependency and nobody stars infrastructure. The 2025-07-25 release date is the real health indicator and it is positive — the package is receiving maintenance releases, including PHP 8.x and Codeception 5 alignment.

Technical risk (ranked).

  1. Live-broker coupling. Every assertion requires a reachable RabbitMQ instance. Tests become integration tests by definition — slower, stateful, and order-sensitive. This is the dominant risk and it is inherent to the tool's purpose, not a defect in the package.
  2. Queue state leakage. Without disciplined teardown, messages from one test bleed into the next. The module provides purgeQueue but does not enforce cleanup; the CI scaffold must.
  3. Small maintainer pool. The Codeception org is a small cohort. Mitigated by the module's thinness — it is a few hundred lines over php-amqplib, so a hard fork is cheap (MIT license permits it).
  4. Version coupling. Must track both php-amqplib major versions and Codeception majors; a Codeception 5→6 bump could lag.
  5. Scope ceiling. Does not model exchanges, routing keys, dead-letter flows, or consumer-side behaviour well; it is queue-centric.

Key questions for the team.

  • Is Codeception actually in use, or is this being evaluated against a PHPUnit/Pest estate? If the latter, stop here.
  • Which Codeception major and which php-amqplib major are we on?
  • Do we already run RabbitMQ in CI, or would this introduce a new service container?
  • Do we need exchange/routing-key assertions that would fall outside this module's scope?
  • Is the flaky-test budget acceptable for the team that owns the suite?

Integration Approach

Stack fit. Required: PHP 8.x, Codeception 5.x, php-amqplib 3.x, and a broker reachable from the test runner. Install is composer require --dev codeception/module-amqp. It is strictly a require-dev entry — verify it does not leak into the production lockfile's autoload path.

Sequencing. Integration is a one-sprint task, best run as a narrow pilot rather than a suite-wide mandate:

  1. Spike (2–3 days). Add the module to a single existing suite, enable it in acceptance.suite.yml with connection parameters sourced from environment variables, and prove one end-to-end assertion — publish via the application code path, assert seeMessageInQueue, purge, assert seeQueueIsEmpty.
  2. CI plumbing. Add a RabbitMQ service container to the pipeline with a per-job vhost. Isolate parallel test workers by vhost or queue-name prefix; a shared vhost will produce cross-worker interference the moment the suite is parallelised.
  3. Teardown convention. Establish a base Cest class or _before/_after hook that purges the queues under test. Bake this in before widening adoption — retrofitting cleanup across an existing suite is where pilot projects die.
  4. Widen. Promote to remaining suites once the convention holds and flake rate is measured.

Migration path. Greenfield — this is additive. There is no migration from an existing tool; the closest comparison is hand-rolled php-amqplib assertions, and replacing those with module methods removes boilerplate rather than adding a dependency burden. If the organisation later moves to Pest/PHPUnit, the exit cost is low: the module's value is concentrated in a handful of assertion helpers that are straightforward to reimplement.

Compatibility. Confirm the module's composer.json constraints against the pinned Codeception and php-amqplib versions before committing; the package's release cadence means constraints are usually current, but a stale pin in our own lockfile is the likelier failure. Docker/Testcontainers-based brokers are the recommended target — do not point CI at a shared staging broker, as test purges would corrupt shared state.

Operational Impact

Maintenance. Near-zero. It is a dev dependency with no deployed footprint, no runtime attack surface, no data handling, and no licensing exposure (MIT). The real maintenance cost is not the package — it is the broker container and the test-suite hygiene it demands.

Support. Upstream is the Codeception organisation with a recent release, so support is adequate for a package of this size. Because the dependency graph is shallow, we retain the ultimate fallback: fork, vendor, or reimplement. Treat "vendor a copy if upstream stalls" as a pre-approved contingency rather than an escalation.

Scaling. Scales linearly with test volume, which is the constraint. Each AMQP assertion is a network round-trip to a broker. At hundreds of message-queue tests, suite wall-clock time becomes the limiting factor and CI cost rises in step. Mitigations: keep AMQP assertions in a dedicated suite that runs on PR-merge rather than every commit, use a small number of long-lived connections, and avoid per-test broker restarts.

Failure modes and tripwires.

  • Flaky tests — the primary operational symptom; will present as intermittent "queue not empty" or timeout errors. Track flake rate from day one and set a threshold (e.g. >2% quarantines the suite) before adoption spreads.
  • CI red herrings — a broker container that fails to become healthy will fail the whole suite with errors that look like application regressions. Add an explicit health check gate and a distinct error signature.
  • Parallel-worker interference — silent, order-dependent, and the hardest to diagnose. Prevented by per-worker vhost isolation, not by discipline.
  • Credential/environment drift — connection params pulled from env vars will diverge between local and CI; document a single source of truth.
  • Broker version skew — pin the RabbitMQ image tag; behaviour differences across major versions can change assertion outcomes.

Ramp-up. Low. Engineers familiar with Codeception write these assertions on day one; the module's API is self-describing. The learning is not the package but message-queue testing discipline — asynchrony, eventual consistency, and teardown. Budget a short internal write-up on the teardown convention and the pitfalls of asserting on a broker before the consumer has drained it.

Verdict. Adopt if — and only if — Codeception is the incumbent test framework. The package is the right, low-risk, correctly-maintained choice for that narrow case, and the cost is bounded and reversible. Do not adopt as a reason to introduce Codeception, and do not let the 4-star / 0-dependent surface signal drive the decision; those numbers reflect the package category, not its quality. The genuine risk sits entirely in broker lifecycle management and test hygiene, which are ours to own, not the package's to solve.

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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings