You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For reasons of compatibility with an external service, I had to develop a custom Transport serializer used by Symfony Messenger. Like the default Serializer i want to serialize all the stamps in Header.
But when an error occurs when it consume the message, I noticed a fatal error related to a warning in FlattenExceptionNormalizer : Warning: Undefined array key "message".
After debugging it would seem that when the serializer serializes data from a FlattenException class it would use ProblemNormalizer from Serializer component and not FlattenExceptionNormalizer from Messenger component. And so in the end the serialized data does not include the message and to denormalize it causes an error.
So I have to remove the ErrorDetailsStamp from the headers in the encode function for it to work.
How to reproduce
Create a custom Messenger serializer for transport :
We experience similar issue with ErrorDetailsStamp. We have custom serializer which is almost the same as Amorfx's one. I get slightly different exception, though:
Failed to denormalize attribute "dataRepresentation" value for class "Symfony\Component\ErrorHandler\Exception\FlattenException": Expected argument of type "Symfony\Component\VarDumper\Cloner\Data", "null" given at property path "dataRepresentation".
As a temporary solution, i removed "ErrorDetailsStamp"
Symfony version(s) affected
6.2.5
Description
For reasons of compatibility with an external service, I had to develop a custom Transport serializer used by Symfony Messenger. Like the default Serializer i want to serialize all the stamps in Header.
But when an error occurs when it consume the message, I noticed a fatal error related to a warning in FlattenExceptionNormalizer :
Warning: Undefined array key "message"
.After debugging it would seem that when the serializer serializes data from a FlattenException class it would use ProblemNormalizer from Serializer component and not FlattenExceptionNormalizer from Messenger component. And so in the end the serialized data does not include the message and to denormalize it causes an error.
So I have to remove the ErrorDetailsStamp from the headers in the encode function for it to work.
How to reproduce
Create a custom Messenger serializer for transport :
Possible Solution
No response
Additional Context
The text was updated successfully, but these errors were encountered: