-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Open
Labels
Description
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 app B
Messages needs to be "sanitized" before leaving the app:
- stamps should be removed: if a stamp exists in 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. - header
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 :)
alamirault, kbond, majermi4, Zausenec, Gemorroj and 1 more