New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Messenger] Sanitize message when the receiver is another app #49081
Comments
For external applications you can use a custom serializer afaik. If so we could provide a simple JSON serializer that adds none of that stuff. |
I also use plain JSON when dealing with interoperability. It's easier IMHO |
I agree with this: IMO this is such a common task, it should not require boilerplate code in user land, and maybe it should be documented |
Thank you for this issue. |
Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3 |
This has not been resolved. |
Description
Hello,
Messenger is a great component, but has some drawbacks when it comes to send messages across different apps which use messenger.
Let's pretend an app
A
sends message through rabbitMQ, that will be consumed by an appB
Messages needs to be "sanitized" before leaving the app:
A
and not in appB
, whenA
sends messages toB
, an error could occur. As well as if appA
uses a bus which not exist in appB
,B
will try to get a bus which does not exist and an error will be thrown.type
could also be problematic: if PHP message objects in both apps do not have the same FQCN, when appB
receives the message it will try to deserialize it in a class which does not exist.A solution would be to add a new interface
ExternalMessageInterface
and take some actions when the interface is encountered in\Symfony\Component\Messenger\Transport\Serialization\Serializer
.I don't think we could fix this with a middleware, because the header
type
is added at serialization time.I'd like to have some feedback on this before fixing it.
Thanks :)
The text was updated successfully, but these errors were encountered: