PHPackages                             andreo/eventsauce-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. andreo/eventsauce-messenger

AbandonedLibrary[API Development](/categories/api)

andreo/eventsauce-messenger
===========================

Symfony messenger for EventSauce message dispatcher.

05.6k1PHP

Since Jul 24Pushed 11mo agoCompare

[ Source](https://github.com/andreo-code/eventsauce-messenger)[ Packagist](https://packagist.org/packages/andreo/eventsauce-messenger)[ RSS](/packages/andreo-eventsauce-messenger/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (8)Versions (5)Used By (1)

eventsauce-messenger 3.0
------------------------

[](#eventsauce-messenger-30)

Integration symfony messenger for EventSauce

### Installation

[](#installation)

```
composer require andreo/eventsauce-messenger
```

#### Previous versions doc

[](#previous-versions-doc)

- [2.0](https://github.com/eventsauce-symfony/eventsauce-messenger/tree/2.0.0)

### Requirements

[](#requirements)

- PHP &gt;=8.2
- Symfony messenger ^6.2

#### Event consumption

[](#event-consumption)

[See more about Event Consumers](https://eventsauce.io/docs/reacting-to-events/projections-and-read-models/)

Message handler example

```
use Andreo\EventSauce\Messenger\EventConsumer\InjectedHandleMethodInflector;
use EventSauce\EventSourcing\EventConsumption\EventConsumer;
use EventSauce\EventSourcing\EventConsumption\HandleMethodInflector;
use Andreo\EventSauce\Messenger\Attribute\AsEventSauceMessageHandler;
use EventSauce\EventSourcing\Message;

final class FooBarBazMessageHandler extends EventConsumer
{
    // copy-paste trait for inject HandleMethodInflector of EventSauce
    // This example use EventSauce\EventSourcing\EventConsumption\InflectHandlerMethodsFromType. Remember, register your way
    use InjectedHandleMethodInflector;

    public function __construct(
        private HandleMethodInflector $handleMethodInflector
    )
    {}

    #[AsEventSauceMessageHandler(bus: 'eventBus')]
    public function onFooCreated(FooCreated $fooCreated, Message $message): void
    {
    }

    // You can define more handlers also union types(only with InflectHandlerMethodsFromType) if you want as below
    #[AsEventSauceMessageHandler(bus: 'eventBus')]
    public function onBarOrBazCreated(BarCreated|BazCreated $barCreated, Message $message): void
    {
    }
}
```

### Configuration

[](#configuration)

`AsEventSauceMessageHandler` attribute works with symfony autoconfigure feature. If you want to use you need to register attribute.

```
use Andreo\EventSauce\Messenger\DependencyInjection\RegisterEventSauceMessageHandlerAttribute;

class Kernel extends BaseKernel
{
    use MicroKernelTrait;

    protected function build(ContainerBuilder $container): void
    {
        RegisterEventSauceMessageHandlerAttribute::register($container);
    }
}
```

If you don't want to use autoconfiguration, you can register the handlers manually.

```
services:
  # ...
  App\Handler\FooBarBazMessageHandler:
    tags:
      -
        name: messenger.message_handler
        handles: App\Message\FooCreated
        bus: eventBus
        method: handle # must be set handle method of EventSauce EventConsumer
      -
        name: messenger.message_handler
        handles: App\Message\BarCreated
        bus: eventBus
        method: handle
      -
        name: messenger.message_handler
        handles: App\Message\BazCreated
        bus: eventBus
        method: handle
```

#### Rest configuration

[](#rest-configuration)

Your services

```
services:
  # ...
    Andreo\EventSauce\Messenger\Dispatcher\MessengerMessageDispatcher:
      arguments:
        $eventBus: 'eventBus' # bus alias from messenger config

    Andreo\EventSauce\Messenger\Middleware\HandleEventSauceMessageMiddleware:
      arguments:
        # change handlers locator prefix to your bus alias from messenger config
        $handlersLocator: '@eventBus.messenger.handlers_locator'
```

Messenger config

```
framework:
  messenger:
    # ...
    buses:
      eventBus:
        # disable default config of messenger middleware
        default_middleware: false
        # minimal middleware config. Note that there are other middleware you may want to use - check messenger docs
        middleware:
          - 'send_message'
          - 'Andreo\EventSauce\Messenger\Middleware\HandleEventSauceMessageMiddleware'
          - 'handle_message' # if you want to use default handling also, this middleware must be last set
```

#### More details

[](#more-details)

[Test App](https://github.com/eventsauce-symfony/eventsauce-messenger/tree/main/Tests/App)

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~137 days

Total

4

Last Release

1219d ago

Major Versions

1.0.0 → 2.0.02022-05-22

2.0.0 → 3.02023-02-01

PHP version history (2 changes)1.0.0PHP ^8.1

3.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/106359?v=4)[andreo](/maintainers/andreo)[@andreo](https://github.com/andreo)

---

Top Contributors

[![andreo-code](https://avatars.githubusercontent.com/u/18660333?v=4)](https://github.com/andreo-code "andreo-code (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

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

8.5k5.9M738](/packages/sylius-sylius)[shopware/storefront

Storefront for Shopware

684.6M236](/packages/shopware-storefront)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)

PHPackages © 2026

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