PHPackages                             mrandmrssmith/symfony-messenger-json-serializer - 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. mrandmrssmith/symfony-messenger-json-serializer

ActiveLibrary[API Development](/categories/api)

mrandmrssmith/symfony-messenger-json-serializer
===============================================

Provide a JSON serializer for Symfony Messenger messages

v2.0.0(3mo ago)04.1k↓18.8%MITPHPPHP &gt;=7.2

Since Feb 23Pushed 3mo ago7 watchersCompare

[ Source](https://github.com/mrandmrssmith/symfony-messenger-json-serializer)[ Packagist](https://packagist.org/packages/mrandmrssmith/symfony-messenger-json-serializer)[ RSS](/packages/mrandmrssmith-symfony-messenger-json-serializer/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (2)Dependencies (18)Versions (4)Used By (0)

Symfony Messenger JSON Serializer
=================================

[](#symfony-messenger-json-serializer)

A JSON serializer for external messages from Symfony Messenger. This will allow you to have one single JSON serializer for all your external message. You only need to register the service, alias it and mention which message you would like to be deserialized.

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

[](#installation)

Add this package to your project

```
composer require mrandmrssmith/symfony-messenger-json-serializer
```

Usage
-----

[](#usage)

1. Configure Messenger

```
framework:
    messenger:
        transports:
            external:
                dsn: '%env(MESSENGER_DSN)%'
                serializer: external_message.messenger.serializer

        routing:
             'MrAndMrsSmith\Queue\ExternalMessage': external
```

2. Configure your serializer

```
  external_message.messenger.serializer:
    class: MrAndMrsSmith\SymfonyMessengerJSONSerializer\Serializer\MessengerJSONSerializer
    factory: [MrAndMrsSmith\SymfonyMessengerJSONSerializer\Serializer\MessengerJSONSerializerFactory, 'create']
    arguments:
      $serializer: '@serializer'
      $messageClassResolver:  MrAndMrsSmith\Queue\ExternalMessage
```

That will create a serializer with default resolver which will use the message class name to deserialize the message. But you can create your own resolver and pass it to the serializer. Your resolver should implement `MessageClassResolver` and you can implement your own logic to resolve class name base on data in message for example get event name from header

```
class MyMessageClassResolver implements MessageClassResolver
{
    public function resolveClass(array $encodedEnvelope): string;
    {
      // your logic to resolve class name
    }
}
```

```
  external_message.messenger.serializer:
    class: MrAndMrsSmith\SymfonyMessengerJSONSerializer\Serializer\MessengerJSONSerializer
    arguments:
      $serializer: '@serializer'
      $messageClassResolver: '@my_message_class_resolver'

  my_message_class_resolver:
    class: MyMessageClassResolver
```

Support
-------

[](#support)

🤗 Please consider contributing if you feel you can improve this package, otherwise submit an issue via the GitHub page and include as much information as possible, including steps to reproduce, platform versions and anything else to help pinpoint the root cause.

Contributing
------------

[](#contributing)

👍 If you do contribute, we thank you, but please review the [CONTRIBUTING](CONTRIBUTING.md) document to help us ensure the project is kept consistent and easy to maintain.

Versioning
----------

[](#versioning)

⌛ This project will follow [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html).

Changes
-------

[](#changes)

🛠️ All project changes/releases are noted in the GitHub releases page and in the [CHANGELOG](CHANGELOG.md) file.

Following conventions laid out by [keep a changelog](https://keepachangelog.com/en/1.1.0/).

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance78

Regular maintenance activity

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 84.6% 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 ~748 days

Total

2

Last Release

115d ago

Major Versions

v1.0.0 → v2.0.02026-03-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/a989b8a3335341544d351bceefcaa8426dc3a7af9df556a978beae890a330803?d=identicon)[gui-ver](/maintainers/gui-ver)

---

Top Contributors

[![gui-ver](https://avatars.githubusercontent.com/u/11404912?v=4)](https://github.com/gui-ver "gui-ver (11 commits)")[![jackwilsonsmith](https://avatars.githubusercontent.com/u/113099660?v=4)](https://github.com/jackwilsonsmith "jackwilsonsmith (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mrandmrssmith-symfony-messenger-json-serializer/health.svg)

```
[![Health](https://phpackages.com/badges/mrandmrssmith-symfony-messenger-json-serializer/health.svg)](https://phpackages.com/packages/mrandmrssmith-symfony-messenger-json-serializer)
```

###  Alternatives

[sylius/sylius

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

8.5k5.9M737](/packages/sylius-sylius)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M339](/packages/api-platform-core)[pimcore/pimcore

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

3.8k3.8M508](/packages/pimcore-pimcore)[shopware/platform

The Shopware e-commerce core

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

Shopware platform is the core for all Shopware ecommerce products.

585.6M577](/packages/shopware-core)[sulu/sulu

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

1.3k1.4M204](/packages/sulu-sulu)

PHPackages © 2026

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