Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Messenger and notifications

Background work in the DXP - Symfony Messenger with the ibexa/messenger transport (database table by default, sync on SQLite), consuming messages, failed messages, and ibexa/notifications for user notifications such as…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/dxp-developers/messenger-and-notifications.md

On this page

Messenger and notifications

This page is for developers who run background work and user notifications on the DXP. Two packages of the metapackage are involved: ibexa/messenger (queues on top of Symfony Messenger) and ibexa/notifications (notifications through Symfony's notifier and mailer).

Contents

  1. Messenger in the DXP
  2. Choosing the transport
  3. Consuming messages
  4. Notifications
  5. Mail in development

Messenger in the DXP

ibexa/messenger registers its own bus and a transport named ibexa.messenger.transport. Its configuration key is ibexa_messenger.transport_dsn; the default, read from the package, is a Doctrine transport on the current repository connection with the table ibexa_messenger_messages. It also adds middleware that deduplicates messages with a lock store (table ibexa_messenger_lock_keys).

Your project's own config/packages/messenger.yaml (from the recipe) defines a sync:// transport and commented lines for an async transport on MESSENGER_TRANSPORT_DSN and a failed transport.

Choosing the transport

SituationTransport
SQLiteMESSENGER_TRANSPORT_DSN=sync:// (the guide: the Doctrine transport "requires a second DB connection that may not be available on SQLite")
MySQL, MariaDB, PostgreSQLThe Doctrine transport (default), consumed by a worker
High volumeA dedicated broker supported by Symfony Messenger

With sync://, messages are handled during the request that sends them: simple, but the request waits.

Consuming messages

php bin/console messenger:consume ibexa.messenger.transport --limit=100   # handle and exit
php bin/console messenger:stop-workers                                   # ask running workers to stop after a deploy

Run consumers under a process manager (for example a systemd service) that restarts them, and send messenger:stop-workers after every deploy so they load the new code. To keep failed messages for later, uncomment the failed transport and failure_transport in messenger.yaml.

Notifications

ibexa/notifications connects content events to Symfony's notifier. An installed project subscribes two user notifications to email in config/packages/ibexa.yaml:

ibexa:
    system:
        default:
            notifier:
                subscriptions:
                    Ibexa\Contracts\User\Notification\UserPasswordReset:
                        channels: [email]
                    Ibexa\Contracts\User\Notification\UserInvitation:
                        channels: [email]

These mails need a working MAILER_DSN.

Mail in development

Keep MAILER_DSN=null://null in development so no mail leaves the machine, and give test users addresses at example.invalid. Test real delivery on a staging server with a mailbox you own.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x