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
Doctrine Messenger

Doctrine Messenger Laravel Package

symfony/doctrine-messenger

Doctrine Messenger provides Doctrine integration for Symfony Messenger, letting you store and transport messages using a Doctrine database as the queue backend.

View on GitHub
Deep Wiki
Context7

Symfony Doctrine Messenger Bridge

Frequently asked questions about Doctrine Messenger
Can I use symfony/doctrine-messenger in a Laravel application?
Only with substantial custom work. The package is a Symfony bridge built on Symfony Messenger, DependencyInjection, EventDispatcher and Console, plus Doctrine ORM/DBAL, while Laravel's queue and bus run on Illuminate components. Bridging the two requires custom adapters, schema migrations and handler rewrites. For most Laravel teams the native database queue driver is a far better fit.
Does symfony/doctrine-messenger work with Laravel's queue system out of the box?
No. Symfony Messenger transports implement Symfony's TransportInterface and carry Symfony message envelopes, whereas Laravel dispatches Illuminate queue jobs through its own Queue and Bus contracts. There is no shared abstraction between the two. You would have to write an adapter layer and translate envelopes into Laravel jobs.
How do I install symfony/doctrine-messenger with Composer?
Run composer require symfony/doctrine-messenger. In a Symfony app you also need symfony/messenger plus doctrine/dbal or doctrine/orm, and the Doctrine transport is configured under framework.messenger in Symfony config. Laravel does not read Symfony's messenger configuration, so a Laravel integration would additionally need doctrine/dbal and custom service wiring.
What PHP and Symfony versions does symfony/doctrine-messenger require?
The package tracks Symfony's release cycle, so recent versions target modern PHP and Symfony 7.x/8.x lines; Symfony 8 requires PHP 8.4 or newer. Always check the exact constraints in composer.json for the version you install. In Laravel you must also confirm that those requirements do not conflict with the Symfony component versions your Laravel release pins.
What database tables does the Doctrine Messenger transport create?
The Doctrine transport provisions a message table, and a message_history table when message history or a failure transport is used. Its column types and constraints are Doctrine-specific, including mutable datetime columns and PostgreSQL triggers. Laravel's default jobs and failed_jobs tables use a different schema, so custom migrations are unavoidable in a mixed setup.
Is symfony/doctrine-messenger a drop-in replacement for Laravel's database queue driver?
No. Laravel's database driver stores serialized jobs in the jobs and failed_jobs tables and works with ShouldQueue, job middleware, batching and queue events. Doctrine Messenger uses its own message format, its own worker command and its own retry semantics. Switching would mean rebuilding the Laravel queue features you rely on.
How would I test a Doctrine Messenger integration inside Laravel?
You would need coverage on both sides: Symfony transport behaviour such as transactions, retries and deadlocks, and Laravel's queue lifecycle such as dispatch, release and failure handling. Integration tests should exercise rollbacks and retry paths against a real database. Most teams find that burden outweighs the benefit compared with testing Laravel's built-in queue.
What are the production risks of running Doctrine Messenger alongside Laravel queues?
Extra abstraction layers can reduce throughput, and two queue systems sharing one database raises the risk of lock contention and deadlocks. Failure handling, monitoring and horizontal scaling must be designed for both stacks. Version drift between Symfony components and the Symfony packages Laravel pins is a recurring maintenance risk.
Who maintains symfony/doctrine-messenger and where do I report issues?
It is maintained by the Symfony team as part of the Symfony ecosystem. Issues and pull requests are handled in the main symfony/symfony repository rather than this split package repository. That also means Laravel-specific integration problems are unlikely to be fixed upstream.
What alternatives should Laravel developers consider instead?
Laravel's own database queue driver, Redis or SQS through Laravel's queue connections, and packages such as spatie/laravel-queue-s3 or pda/pheanstalk. If you need middleware stacks, retry strategies or transport plugins, Laravel job middleware and queue events cover much of that ground. Keep symfony/doctrine-messenger for Symfony applications where Doctrine is already the persistence layer.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections