KonstantinCodes / messenger-kafka

Simple Kafka transport for Symfony Messenger.
MIT License
84 stars 35 forks source link

Component doesn't work anymore when using PHP serialization #20

Closed alsar closed 4 years ago

alsar commented 4 years ago

After adding support for the Symfony serializer https://github.com/KonstantinCodes/messenger-kafka/pull/6 the component stopped working when using the PhpSerializer which is the default serializer when using Messenger.

Because the PhpSerializer doesn't add headers (because it doesn't need to) but the KafkaTransport requires the key to be set here.

Could we add a check if $payload['headers'] doesn't exist (or if PhpSerializer is used)? In this case just set it to null.

KonstantinCodes commented 4 years ago

Thank you @alsar I have pushed the change and added Tests.