Closed
Description
Symfony version(s) affected: 4.3.x
Description
Symfony\Component\Messenger\Transport\Doctrine\Connection does not json_encode headers when using ::all() and ::find() methods of DoctrineReceiver.
This leads to MessageDecodingFailedException when using Symfony\Component\Messenger\Transport\Serialization\Serializer
How to reproduce
- use doctrine transport
- use messenger.transport.symfony_serializer
- fetch envelopes with ListableReceiverInterface methods
Possible Solution
- separate message type from headers in table schema
- or simply json_encode headers when using find() and all()
Additional context
PhpSerializer would do the work, but it fails on serializing of Closure object.
This issue occured when trying to transport Sentry events with message bus.