This project integrates the Symfony Messenger component into Drupal, enabling asynchronous message processing and providing a framework for more robust background task management. It offers integrations with various transport mechanisms, message scheduling, and asynchronous email sending.
This project integrates the Symfony Messenger component with Drupal.
Extensive documentation is available in the README, from installation, configuration, and developer guidance.
See also the Symfony Messenger series of posts on the PreviousNext blog:
- Introducing Symfony Messenger integrations with Drupal
- Symfony Messenger’ message and message handlers, and comparison with @QueueWorker
- Real-time: Symfony Messenger’ Consume command and prioritised messages
- Automatic message scheduling and replacing hook_cron
- Adding real-time processing to QueueWorker plugins
- Making Symfony Mailer asynchronous: integration with Symfony Messenger
- Displaying notifications when Symfony Messenger messages are processed
- Future of Symfony Messenger in Drupal
💬 General support and casual project planning can be found in Drupal Slack #symfony-messenger.
Requirements
Any actively supported version of Drupal core. All other dependencies are automatically managed by Composer.
Versions and Upgrading
For Drupal 11.4, 12, and above, use v1. When upgrading from SM v0.x, make sure to switch any use of command to the new Drupal core CLI with dr. v1 is intended to be a drop in replacement for v0.2 / v0.3.
Drupal 10 and 11, may use any SM v0. From v0.3, you may opt to use either the sm or dr entry point.
Suggested projects
- Transports (usually you'll need one of these)
These are required to handle messages asynchronously. Like a queue; separately from the web thread.- AMQP database transport — for use with RabbitMQ, Apache ActiveMQ, etc
- Redis
- Deprecated: Doctrine database transport — an alternative implementation for SQL, for use with Postgres, MySQL, etc. (SM is already bundled with a Drupal SQL native transport)
- Message Scheduler — Automatically sends messages (queue items) on a recurring schedule, in the same manner as cron and crontab syntax.
- Mailer
- Symfony Mailer integration — transmit emails asynchronously; separately from the web thread. Requires a patch.
- Symfony Mailer Lite integration — and again, transmit emails asynchronously; separately from the web thread.
- Batch Messenger — Group Symfony Messenger messages together into a collection. Expose a UI of progress of each collection. Intercept and convert Batch API calls (
batch_set) to Messenger messages. - Notifier — Provides a unified way to send email, SMS, chat messages. Integrates with Symfony Message for dispatch.