PHPackages                             sulu/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. [API Development](/categories/api)
4. /
5. sulu/messenger

ActiveSulu-bundle[API Development](/categories/api)

sulu/messenger
==============

This library provides the stamps, middlewares and the sulu message bus.

1.0.0(3mo ago)994.2k—6.9%41MITPHPPHP 8.2.\* || 8.3.\* || 8.4.\* || 8.5.\*

Since Mar 10Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/sulu/messenger)[ Packagist](https://packagist.org/packages/sulu/messenger)[ RSS](/packages/sulu-messenger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (33)Versions (17)Used By (1)

Sulu Messenger
==============

[](#sulu-messenger)

 [ ![Official Sulu Bundle Badge](https://camo.githubusercontent.com/8ac484ac60dbf97b4f747c6d0f704a16d2c005414d62dfcb2525b7c4cbf82466/68747470733a2f2f73756c752e696f2f75706c6f6164732f6d656469612f383030782f30302f3233302d4f6666696369616c25323042756e646c652532305365616c2e7376673f763d322d3626696e6c696e653d31) ](https://sulu.io/)

 [ ![GitHub license](https://camo.githubusercontent.com/3790db4464525283bd07335deddc21bb6d1b1875b68cf11f3f15025f72f39de5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73756c752f6d657373656e6765722e737667) ](LICENSE) [ ![GitHub tag (latest SemVer)](https://camo.githubusercontent.com/13fbe95f8eb7cc7e8994e28b4ae6979863b8cb2831d458fe517101a4dfbe62b2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f73756c752f6d657373656e6765722e737667) ](https://github.com/sulu/messenger/releases) [ ![Test workflow status](https://camo.githubusercontent.com/63cb8f262750cdbf84dc7f31e0fa06ad8a76b8caed9310d1f338064a6ff91742/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73756c752f6d657373656e6765722f746573742d6170706c69636174696f6e2e79616d6c) ](https://github.com/sulu/messenger/actions) [ ![Sulu compatibility](https://camo.githubusercontent.com/90a56b0395c28be216880d53f87f9c4ad379b6bdad189115e0561c508f899d2c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73756c75253230636f6d7061746962696c6974792d2533453d322e302d3532623663612e737667) ](https://github.com/sulu/sulu/releases)

This library provides the stamps and middlewares which configures the Sulu message bus. It can be used independently in any Symfony installation.

Installation
------------

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Open a command console, enter your project directory and execute:

```
composer require sulu/messenger
```

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    Sulu\Messenger\Infrastructure\Symfony\HttpKernel\SuluMessengerBundle::class => ['all' => true],
];
```

Middlewares
-----------

[](#middlewares)

### UnpackExceptionMiddleware

[](#unpackexceptionmiddleware)

The `UnpackExceptionMiddleware` will unpack the `HandlerFailedException` which is created by the Symfony [`HandleMessageMiddleware`](https://github.com/symfony/symfony/blob/c7dbcc954366f92f66360f3960a10dc1ef5f2584/src/Symfony/Component/Messenger/Middleware/HandleMessageMiddleware.php#L129). This way we make sure that the real exception is thrown out by this message bus, and a controller can catch or convert it to a specific http status code. This middleware is always activated in the Sulu message bus.

### LockMiddleware

[](#lockmiddleware)

The `LockMiddleware` will allow to lock specific resources by a given key. This is commonly used to prevent concurrent access to the same resource and avoid race conditions. The locking can be activated and controlled via the `LockStamp` which supports the same parameters as the Symfony `LockFactory` to create the Lock.

```
use Sulu\Messenger\Infrastructure\Symfony\Messenger\LockMiddleware\LockStamp;

$this->handle(new Envelope(new YourMessage(), [new LockStamp('lock-key')]));

# set ttl and autorelease
$this->handle(new Envelope(new YourMessage(), [new LockStamp('lock-key', 300.0, true)]));

# multiple locks possible all locks need to be acquired before processing the message
$this->handle(new Envelope(new YourMessage(), [new LockStamp('lock-key-1'), new LockStamp('lock-key-2')]));
```

This middleware is always activated in the Sulu message bus.

### DoctrineFlushMiddleware

[](#doctrineflushmiddleware)

The `DoctrineFlushMiddleware` is a Middleware which let us flush the Doctrine EntityManager by an opt-in flag via the `EnableFlushStamp`. It can be used this way:

```
use Sulu\Messenger\Infrastructure\Symfony\Messenger\FlushMiddleware\EnableFlushStamp;

$this->handle(new Envelope(new YourMessage(), [new EnableFlushStamp()]));
```

This middleware is always activated in the Sulu message bus.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance82

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 73.9% 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 ~110 days

Recently: every ~65 days

Total

14

Last Release

97d ago

Major Versions

0.2.11 → 1.0.02026-02-10

PHP version history (6 changes)0.1.0PHP 8.0.\* || 8.1.\*

0.2.1PHP 8.0.\* || 8.1.\* || 8.2.\*

0.2.3PHP 8.0.\* || 8.1.\* || 8.2.\* || 8.3.\*

0.2.5PHP 8.0.\* || 8.1.\* || 8.2.\* || 8.3.\* || 8.4.\*

0.2.9PHP 8.0.\* || 8.1.\* || 8.2.\* || 8.3.\* || 8.4.\* || 8.5.\*

1.0.0PHP 8.2.\* || 8.3.\* || 8.4.\* || 8.5.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dbafb2ec00aab7a9f476cf2dd77f63923acfda214ec7bf728c662a9e88f39c7?d=identicon)[chirimoya](/maintainers/chirimoya)

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

![](https://avatars.githubusercontent.com/u/1698337?v=4)[Alexander Schranz](/maintainers/alexander-schranz)[@alexander-schranz](https://github.com/alexander-schranz)

![](https://www.gravatar.com/avatar/79a96e73697310472951fe9173230a10d1d23f6a5b8074d260d2bb848dcbb775?d=identicon)[Prokyonn](/maintainers/Prokyonn)

---

Top Contributors

[![alexander-schranz](https://avatars.githubusercontent.com/u/1698337?v=4)](https://github.com/alexander-schranz "alexander-schranz (17 commits)")[![mamazu](https://avatars.githubusercontent.com/u/14860264?v=4)](https://github.com/mamazu "mamazu (2 commits)")[![mario-fehr](https://avatars.githubusercontent.com/u/14167832?v=4)](https://github.com/mario-fehr "mario-fehr (2 commits)")[![benr77](https://avatars.githubusercontent.com/u/2156742?v=4)](https://github.com/benr77 "benr77 (1 commits)")[![Prokyonn](https://avatars.githubusercontent.com/u/25978473?v=4)](https://github.com/Prokyonn "Prokyonn (1 commits)")

---

Tags

commandbusmessagebusmessengersymfonysymfony-bundle

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

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

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

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)

PHPackages © 2026

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