emag-tech-labs/messenger-mongo-bundle
A Symfony Messenger transport that stores queued and failed messages in MongoDB. Install via Composer, configure DSN, database, collection, queue, and redeliver timeout, then use standard Messenger retry and failed-message commands.
Architecture fit. The single most important finding is a framework mismatch: this is a Symfony Messenger transport, not a Laravel package. Laravel's queue abstraction (Illuminate\Queue, drivers, workers, Horizon, failed_jobs) has no awareness of Symfony\Component\Messenger. Nothing in this bundle registers a Laravel service provider, exposes a Laravel queue connector, or integrates with Laravel's retry/backoff/failure semantics. For a Laravel codebase, this is not a drop-in dependency — it is an adoption of a second, parallel messaging runtime. That is a legitimate architecture, but it is an architecture decision, not an integration detail, and should be framed to stakeholders as such.
Integration feasibility. Feasible but non-trivial:
symfony/messenger, symfony/serializer, symfony/config, symfony/dependency-injection) are framework-agnostic and can run inside a Laravel app. The bundle itself, however, expects Symfony's kernel, bundle registration, and DI conventions. Expect to either (a) instantiate the transport/connection classes manually and wire a custom Laravel service provider, or (b) use Symfony's standalone MessengerPass/container in a separate worker process. Both are custom glue code we own.mongodb/mongodb (the official PHP library). Laravel MongoDB users typically run mongodb/laravel-mongodb, which also pulls the same underlying ext-mongodb + library. Version alignment is likely workable but must be verified against our pinned Laravel and PHP versions; a Composer conflict here stalls the whole initiative.Technical risk.
findOneAndUpdate-style reservation, and TTL-based cleanup do not give us the delivery guarantees or throughput profile of Redis/SQS/RabbitMQ.queue:monitor, no standard metrics. We would own dashboards and alerting from scratch.Key questions to resolve before committing.
Stack fit. Target stack is Laravel (assume 10/11) + PHP 8.x + existing ext-mongodb. Symfony components coexist with Laravel routinely, so a standalone Messenger worker process (separate from php artisan queue:work) is the cleanest fit. We should not attempt to shoehorn this into config/queue.php as a driver; that path leads to fighting Laravel's worker lifecycle. Treat the Messenger worker as a second runtime with its own supervisor/process manager entry, its own health check, and its own deployment artifact.
Migration path. Three options, in ascending cost:
Compatibility work items. Lock PHP and Laravel versions; resolve mongodb/mongodb vs mongodb/laravel-mongodb version constraints in a spike branch; confirm ext-mongodb version parity across dev/CI/prod; validate serialization (Symfony Serializer vs Laravel's job serialization) for any message carrying Eloquent models — do not serialize Eloquent models across this boundary; pass IDs and rehydrate.
Sequencing.
availableAt, TTL on completed), load test at 5–10× expected peak, measure write amplification on the Mongo cluster.Maintenance. We are effectively adopting a lightly-maintained dependency with no external dependents. Budget for the real possibility of vendoring or forking the transport class. Pin the version, and add it to the dependency-review list with an explicit owner and a quarterly upstream check. Note the last release date (2026-01-14) suggests recent activity, but activity ≠ stability; verify changelog cadence and issue responsiveness before committing.
Support. Community support is thin — no Stack Overflow corpus, no Laravel-ecosystem familiarity. Internal runbooks must be written by us: how to inspect the collection, how to requeue a stuck message, how to purge, how to interpret reservation timeouts. On-call will be learning a bespoke system, not a well-trodden one.
Scaling. Scaling characteristics are driven by Mongo, not by the bundle: polling frequency sets baseline read load; worker concurrency sets reservation contention; the queue collection adds write pressure to a cluster that may also serve product traffic. Horizontal scaling means more workers contending on the same documents — verify reservation atomicity under concurrency before scaling out. Storage growth is unbounded unless TTL/archival is configured and tested.
Failure modes to design for.
Ramp-up. Engineers must learn Symfony Messenger's semantics (envelope, stamps, middleware, retry strategy) on top of Laravel's queue mental model they already hold. Realistically 1–2 weeks of productive ramp for one engineer, plus the operational runbook effort. Factor that into the cost case — the license is free, the integration and ownership are not.
Bottom line for the decision record: this package solves a real problem for Symfony shops that already run Mongo, and the README is refreshingly honest about Mongo's limits as a queue. For a Laravel codebase with essentially no adoption footprint, the defensible move is to pilot it as a failure/audit transport, not as the primary queue, and only expand if the pilot demonstrates acceptable duplicate rates, reservation behavior, and Mongo load.
How can I help you explore Laravel packages today?