Just an very simple serializer for symfony messenger and CommerceTools messages.
$ composer require best-it/commercetools-message-serializer
# services.yaml
services:
BestIt\Messenger\CommerceToolsSerializer:
class: BestIt\Messenger\CommerceToolsSerializer
# messenger.yaml
framework:
messenger:
serializer:
default_serializer: 'BestIt\Messenger\CommerceToolsSerializer'
Every message has a header parameter X-CommerceTools-Message
which contains the full qualified class name of the
CommerceTools message (e.g.: Commercetools\Core\Model\Message\OrderCreatedMessage
).