PHPackages                             goetas/messenger-doctrine-outbox - 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. goetas/messenger-doctrine-outbox

ActiveLibrary

goetas/messenger-doctrine-outbox
================================

Transactional outbox implementation for Symfony messenger (https://microservices.io/patterns/data/transactional-outbox.html)

0.x-dev(3y ago)2414.5k↓35.7%2MITPHP

Since Jun 10Pushed 3y ago3 watchersCompare

[ Source](https://github.com/goetas/messenger-doctrine-outbox)[ Packagist](https://packagist.org/packages/goetas/messenger-doctrine-outbox)[ RSS](/packages/goetas-messenger-doctrine-outbox/feed)WikiDiscussions 0.x Synced 1mo ago

READMEChangelogDependencies (1)Versions (1)Used By (0)

goetas/messenger-doctrine-outbox
================================

[](#goetasmessenger-doctrine-outbox)

This library provides a middleware and a transport to implement the [Transactional outbox](https://microservices.io/patterns/data/transactional-outbox.html)pattern for the [symfony/messenger](https://symfony.com/doc/current/messenger.html) component.

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

[](#installation)

The recommended installation is via [Composer](https://getcomposer.org/).

```
composer require goetas/messenger-doctrine-outbox:@dev
```

Configuration
-------------

[](#configuration)

```
# config/packages/messenger.yaml
framework:
    messenger:
        transports:

            # add to the list of transport the outbox transport
            outbox:
                dsn: 'outbox-doctrine://default' # "default" in this case is the name of your default doctrine connection
                options:
                    queue_name: outbox # the queue name is mandatory to avoid conflicts with doctrine transport

        buses:
            event.bus:
                middleware:
                    # add to your middlewares the outbox middleware service
                    - 'app.messenger_doctrine_outbox_middleware'

# config/services.yaml
services:
    # define your outbox middleware service
    app.messenger_doctrine_outbox_middleware:
        class: Goetas\MessengerDoctrineOutbox\OutboxMiddleware
        arguments:
            - '@messenger.transport.outbox'

    # define the outbox transport factory
    goetas.messenger_doctrine_outbox_middleware:
        class: Goetas\MessengerDoctrineOutbox\OutboxTransportFactory
        arguments:
            - '@doctrine'
        tags:
            - { name: messenger.transport_factory }
```

Usage
-----

[](#usage)

```
// src/Controller/DefaultController.php
namespace App\Controller;

use App\Message\SmsNotification;
use App\Entity\Sms;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Messenger\MessageBusInterface;

class DefaultController extends AbstractController
{
    public function sendSms(MessageBusInterface $bus, EntityManagerInterface $em)
    {
        $sms = new Sms('hello', '123');

        $em->wrapInTransaction(function() {
            $em->persist($sms);
            $bus->dispatch(new SmsNotification('Look! I created a message!'));
        });
    }

    // if you do not want to use wrapInTransaction()...
    public function sendDifferentSms(MessageBusInterface $bus, EntityManagerInterface $em)
    {
        $sms = new Sms('hello', '123');

        try {
            $em->beginTransaction();

            $em->persist($sms);
            $em->flush();
            $bus->dispatch(new SmsNotification('Look! I created a message!'));

            $em->commit();
        } catch (\Throwable $exception) {
            $em->rollback();
        }
    }
}
```

Running the outbox consumer
---------------------------

[](#running-the-outbox-consumer)

You can run only the outbox consumer with this command:

```
bin/consone bin/console  messenger:consume outbox
```

You can also run all the consumers with the following command.

```
bin/consone bin/console  messenger:consume
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity31

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

Unknown

Total

1

Last Release

1438d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/776743?v=4)[Asmir Mustafic](/maintainers/goetas)[@goetas](https://github.com/goetas)

---

Top Contributors

[![goetas](https://avatars.githubusercontent.com/u/776743?v=4)](https://github.com/goetas "goetas (4 commits)")

### Embed Badge

![Health badge](/badges/goetas-messenger-doctrine-outbox/health.svg)

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

###  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)[pimcore/pimcore

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

3.7k3.7M389](/packages/pimcore-pimcore)[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)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[akeneo/pim-community-dev

Akeneo PIM, the future of catalog management is open!

1.0k614.1k81](/packages/akeneo-pim-community-dev)

PHPackages © 2026

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