PHPackages                             ssch/t3-messenger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. ssch/t3-messenger

ActiveTypo3-cms-extension[Queues &amp; Workers](/categories/queues)

ssch/t3-messenger
=================

Wrapper for Symfony Messenger

v3.0.1(3mo ago)1218.2k↓30%4[1 PRs](https://github.com/sabbelasichon/t3_messenger/pulls)1GPL-2.0+PHPPHP ^8.2CI failing

Since Jan 21Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/sabbelasichon/t3_messenger)[ Packagist](https://packagist.org/packages/ssch/t3-messenger)[ Fund](https://paypal.me/schreiberten)[ GitHub Sponsors](https://github.com/sabbelasichon)[ RSS](/packages/ssch-t3-messenger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (20)Versions (23)Used By (1)

TYPO3 Symfony messenger adapter
===============================

[](#typo3-symfony-messenger-adapter)

Integrates Symfony Messenger into TYPO3

Credits
-------

[](#credits)

Many thanks to [Constructiva Solutions GmbH](https://www.constructiva.de/) that sponsored the development of this extension with a sponsorship and a lot of valuable feedback.

Integration guide
-----------------

[](#integration-guide)

The extension basically provides the same functionality as if you would use the messenger in the Symfony Framework. In order to configure the messenger you have to put a Messenger.php file under the Configuration folder of an extension.

```
return [
    'failure_transport' => 'failed',
    'default_bus' => 'command.bus',
    'transports' => [
        'async' => [
            'dsn' => 'typo3-db://Default',
        ],
        'failed' => [
            'dsn' => 'typo3-db://Default',
            'options' => [
                'queue_name' => 'failed',
            ],
        ],
    ],
    'routing' => [
        MyCommand::class => ['senders' => ['async']],
    ],
    'buses' => [
        'command.bus' => [
            'middleware' => [
                'id' => 'validation',
            ],
        ],
        'query.bus' => [
            'default_middleware' => [
                'enabled' => true,
                'allow_no_handlers' => false,
                'allow_no_senders' => true,
            ],
        ],
    ],
];
```

Extbase Entities in Messages
----------------------------

[](#extbase-entities-in-messages)

If you need to pass an Extbase entity in a message, it's better to pass the entity's primary key (or whatever relevant information the handler actually needs, like email, etc.) instead of the object.

Have a look at the Symfony Documentation about [Doctrine Entities](https://symfony.com/doc/current/messenger.html#doctrine-entities-in-messages)

Transport Configuration
-----------------------

[](#transport-configuration)

Messenger supports a number of different transport types, each with their own options. Options can be passed to the transport via a DSN string or configuration.

Have a look at the Symfony Documentation about [Transports](https://symfony.com/doc/current/messenger.html#transport-configuration)

### Custom Doctrine Transport

[](#custom-doctrine-transport)

The extension ships the [doctrine transport](https://symfony.com/doc/current/messenger.html#doctrine-transport) with a slightly modified configuration DSN. Instead of using doctrine:// you have to use typo3-db://.

```
return [
    'transports' => [
        'async' => [
            'dsn' => 'typo3-db://Default',
        ],
    ],
];
```

The format is typo3-db://&lt;connection\_name&gt;, in case you have multiple connections and want to use one other than the "Default". The transport will automatically create a table named messenger\_messages.

Please have a look for further configuration details at the [doctrine transport](https://symfony.com/doc/current/messenger.html#doctrine-transport).

Null Transport
--------------

[](#null-transport)

The extension ships also with a NullTransport. This is useful if you want some messages in some instances not to be handled at all.

Middleware
----------

[](#middleware)

Have a look at the Symfony Documentation about [Middleware](https://symfony.com/doc/current/messenger.html#middleware) to understand the concept behind it.

The extension ships with a ValidationMiddleware for the extbase Validators. If you want to validate your commands add the middleware the following way in your Messenger.php:

```
return [
    'buses' => [
        'messenger.bus.default' => [
            'middleware' => [
                'id' => 'validation',
            ],
        ],
    ],
];
```

**Note**: The id validation is a shortcut for the service id **messenger.middleware.validation**.

Additionally, the extension ships with a LoggingMiddleware for debugging purposes.

```
return [
    'buses' => [
        'messenger.bus.default' => [
            'middleware' => [
                'id' => 'logging',
            ],
        ],
    ],
];
```

Async Mailer
------------

[](#async-mailer)

The extension ships with a custom MessengerMailer which implements [MailerInterface](https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Mail/MailerInterface.php) from TYPO3 core in order to send emails asynchronously if it is desired. Even if you are using TYPO3 10 you can already use the new MailerInterface. Inject the MailerInterface wherever you want:

```
use TYPO3\CMS\Core\Mail\MailerInterface;
use TYPO3\CMS\Core\Mail\MailMessage;
use TYPO3\CMS\Core\Utility\GeneralUtility;

final class RegistrationService
{
    private MailerInterface $mailer;

    public function __construct(MailerInterface $mailer)
    {
        $this->mailer = $mailer;
    }

    public function register()
    {
        $mailMessage = GeneralUtility::makeInstance(MailMessage::class);
        $mailMessage->setTo('max.mustermann@domain.com');
        $mailMessage->setSubject('You MailerInterface');
        $this->mailer->send($mailMessage);
    }
}
```

If you are sending emails this way, nothing should change. The mails will be sent the way before via the MessengerBus. You could also inject the MailerInterface from Symfony Mailer and you will get the MessengerMailer injected.

If you truly want to send emails asynchronously you have to configure the routing section in your Messenger.php

```
return [
    'routing' => [
        \Symfony\Component\Mailer\Messenger\SendEmailMessage::class => ['senders' => ['async']],
    ]
]
```

Nothing comes for free. There are some caveats to tackle if you are sending emails asynchronously. Also have a look at the Symfony Documentation [Sending Messages Async](https://symfony.com/doc/current/mailer.html#sending-messages-async).

**Note**: Be aware that you should inject either the \\TYPO3\\CMS\\Core\\Mail\\MailerInterface or the \\Symfony\\Component\\Mailer\\MailerInterface in your classes and explicitly pass your MailMessage to the send method. Do not call the send method on the MailMessage object itself because this will bypass the shipped decorator and you cannot send your email messages asynchronously

ConfigurationProvider
---------------------

[](#configurationprovider)

If you have installed **typo3/cms-lowlevel** you can see your Messenger configuration within the Configuration module under the section **Messenger Configuration**

You cannot only see your System wide configuration but also your Messages and the assigned Handlers.

Environment specific configurations
-----------------------------------

[](#environment-specific-configurations)

If you want to handle i.e. your messages synchronously in the development environment but still asynchronously in the production environment you can do so. You just have to place another Messenger.php under Configuration/dev/ in your extension. You can do the same for your testing environment by placing the Messenger.php under Configuration/test/ folder. It is a simple convention but convenient in your daily developer life. Have a look at [Handling Messages Sync while Developing](https://symfonycasts.com/screencast/messenger/dev-sync) why this feature is so convenient.

Further reading
---------------

[](#further-reading)

[Batch processing with Messenger](https://wolfgang-klinger.medium.com/how-to-handle-messages-in-batches-with-symfony-messenger-c91b5aa1c8b1)

[Symfony Messenger without Supervisor](https://dev.to/fadymr/use-symfony-messenger-without-supervisor-3cl6)

Credits
-------

[](#credits-1)

Icons used in this repository are made by \[Freepik\]\[8\] from \[[www.flaticon.com\]\[9](http://www.flaticon.com][9)\]

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance83

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 81.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Recently: every ~183 days

Total

21

Last Release

119d ago

Major Versions

v1.2.6 → v2.0.02023-12-13

2.x-dev → v3.0.02026-01-19

PHP version history (3 changes)v1.0.0PHP ^7.4 || ^8.0

v3.0.0PHP ^8.1

v3.0.1PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/bebdadb696b19cbbca63cd296ae4e4f48bcf42c20bc483d7b4d0599836dc753d?d=identicon)[schreiberten](/maintainers/schreiberten)

---

Top Contributors

[![sabbelasichon](https://avatars.githubusercontent.com/u/13050560?v=4)](https://github.com/sabbelasichon "sabbelasichon (107 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (22 commits)")[![mmunz](https://avatars.githubusercontent.com/u/3017481?v=4)](https://github.com/mmunz "mmunz (1 commits)")[![SiMoeBoe](https://avatars.githubusercontent.com/u/30149236?v=4)](https://github.com/SiMoeBoe "SiMoeBoe (1 commits)")

---

Tags

Messenger

###  Code Quality

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ssch-t3-messenger/health.svg)

```
[![Health](https://phpackages.com/badges/ssch-t3-messenger/health.svg)](https://phpackages.com/packages/ssch-t3-messenger)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[petitpress/gps-messenger-bundle

Google Pub/Sub transport for Symfony Messenger

29491.0k3](/packages/petitpress-gps-messenger-bundle)[koco/messenger-kafka

Symfony Messenger Kafka Transport

931.1M1](/packages/koco-messenger-kafka)[jwage/phpamqplib-messenger

Symfony messenger transport for the php-amqplib/php-amqplib library.

84149.7k1](/packages/jwage-phpamqplib-messenger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
