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
At the moment MessageSerializationRegister has a few areas for improvement:
Inefficient serializer resolution - the current registry works by keying serializers by type, then looping through all serializers in the dictionary and asking "If I am able to get the subject for this message, does it then match the subject of the corresponding type it's keyed by". This is quite odd, and not efficient.
Difficult to customize the subject - The message subject is really used as a way to correlate the deserializer back to the message once it's been partially read (just enough to get the subject), there's no reason we couldn't customize this at registration and say "Hey this subscription will actually have messages with this subject", this will help us with interoping with other platforms.
Inefficient message envelope support - Let's say we want to add CloudEvents or some other format, and be processing some existing JustSaying format messages, you'd be deliberately throwing and catching exceptions constantly as the registry tries to identify the correct serializer. Having a separate envelope deserializer would reduce this to just 2, it could still use trial and error, but reduce the number of serializers to try.
There are two things we could look at to improve this:
SplitIMessageSerializer into two interfaces, where we can have something like a IMessageEnvelopeSerializer who's job is just to get the subject from the general message format (the "envelope" if you will)
Pass through the serializer type via generics all the way from the subscription registration. This would be a bigger change, but not having a MessageSerializationRegister would make a lot of sense. This might be tricky given the fan-in and fan-out approach that subscription groups provide.
The text was updated successfully, but these errors were encountered:
At the moment
MessageSerializationRegister
has a few areas for improvement:There are two things we could look at to improve this:
IMessageSerializer
into two interfaces, where we can have something like aIMessageEnvelopeSerializer
who's job is just to get the subject from the general message format (the "envelope" if you will)MessageSerializationRegister
would make a lot of sense. This might be tricky given the fan-in and fan-out approach that subscription groups provide.The text was updated successfully, but these errors were encountered: