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

Add NatsClient to DI #689

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add NatsClient to DI #689

wants to merge 3 commits into from

Conversation

mtmk
Copy link
Collaborator

@mtmk mtmk commented Dec 4, 2024

This change modifies the default serializer and pending policy, hence it is technically a breaking change.

resolves #687

This change modifies the default serializer and pending policy, hence it is technically a breaking change.
@mtmk mtmk linked an issue Dec 4, 2024 that may be closed by this pull request
@mtmk mtmk requested review from rickdotnet and scottf December 5, 2024 18:39
@mtmk mtmk self-assigned this Dec 7, 2024
@mtmk mtmk added the breaking label Dec 7, 2024
@rickdotnet
Copy link
Collaborator

rickdotnet commented Dec 11, 2024

These changes look good to me.

Does it make sense to keep AddJsonSerialization(...) around anymore? Seems confusing and since it now defaults to JSON, I'm not sure that it's needed. There is documentation for NatsJsonContextSerializerRegistry, could expand on that, if necessary. That combined with WithSerializerRegistry() should be the same functionality. If you wanted to keep the method, I'd still suggest renaming it to WithJsonSerializerContext(params JsonSerializerContext[]) and track it in a similar way and take out the chained options.

@mtmk
Copy link
Collaborator Author

mtmk commented Dec 11, 2024

These changes look good to me.

Does it make sense to keep AddJsonSerialization(...) around anymore? Seems confusing and since it now defaults to JSON, I'm not sure that it's needed. There is documentation for NatsJsonContextSerializerRegistry, could expand on that, if necessary. That combined with WithSerializerRegistry() should be the same functionality. If you wanted to keep the method, I'd still suggest renaming it to WithJsonSerializerContext(params JsonSerializerContext[]) and track it in a similar way and take out the chained options.

@rickdotnet good point. I know I marked this as breaking already (actually not breaking compiler but behaviour) but do you think we'd upset a lot of code bases if we removed the method. hmm maybe obsolete the old one and keep it around for a while whether we introduce a new method or not?

@rickdotnet
Copy link
Collaborator

Safest bet, in my opinion, would be to mark it as obsolete and include a nudge in the right direction, either a new method or a link to docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shouldn't NatsBuilder register NatsClient to DI?
2 participants