Skip to content
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

[DEVEX-222] Add built-in auto-serialization #333

Merged
merged 49 commits into from
Feb 27, 2025

Conversation

w1am
Copy link
Contributor

@w1am w1am commented Feb 27, 2025

No description provided.

…ate method

This should enable easier customisation like changing serializer settings.
Currently it's implemented in a dummy way
…erialization

It's not fully ready, as it has hardcoded schema serializer. Main question will be how much from schema registry I need to move here.
…rom ResolvedEvent

Per @RagingKore suggestion it'll be better not to keep the reference to serializer in ResolvedEvent to keep the clear intention behind it.

Now, the serializer is resolved from schema registry based on the auto-serialization settings.

Made possible to register more than one serializer per content type. Currently it doesn't support more schema definition types. To be discussed how to include them later on.
That will make resolution easier and give users ability to inject their own serializers implementation
…rialization Context

Previously we had DeserializationContext, but after consideration, it'll be better to merge those concepts to make easier customizations per operations (e.g. append, subscribe, etc.).
Refactored the code accordingly. It takes the full object instead of the limited number of parameters, as you may be using metadata to get parameters about clrtype.
…pper to make clearer responsibilities

Actually, it's just wrapping message serializer based on the client settings.
Removed also obsolete SerializationSettings
… IMessageSerializer

There's no need to force all code to know about wrapper existence, it's okay to just create it during the setup.
…ied syntax

Now they don't require all the fancy, but redundant in most cases Stream Positions, Directions, EventData etc.
…ad of parameters

Thanks to that safe defaults are already provided
Old append and read methods won't be doing default serialization by default. The new one will use auto-seriailization and allow to customize or disable it.
…age type name

Now the FullTypeName is placed in the event type name. Not perfect but here it is.
Thanks to that they will be resolved automatically by the registered convention. Then user doesn't need to provide the string name by hand.

Added MessageTypeNamingResolution context besides the MessageSerializationContext as it's orthogonal and just overlapping context.
This is a similar API as we already have in Java client, to simplify the handlers registration.
I think that in the longer term, this will make intention clearer
…ustomize serialization for Persistent Subscriptions
…adata

By default it'll try to resolve the TraceMetadata, it can be override with the general type or using custom resolution strategy.
This reverts commit 04e0685.

I'm reverting it as old methods are wrappers for new ones, so the test scenarios are covered by the old test suite.
Fixed also XML docs comments
Used also two external assemlies
- one that's loaded,
- one that's never loaded.

To double-check behaviour of loading types from different assemblies.
@w1am w1am merged commit dc14196 into DEVEX-185-Rebranding Feb 27, 2025
89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants