This is a NATS.Net bug fix release version 2.1.0-preview.4.
What's Changed
- Support Keyed DI services in .NET 8 by @rickdotnet in #331
- Nullability review for models by @mnmr in #332
- Addition of factories for better testability. by @sspates in #330
- Ordered consumer optimizations by @mtmk in #336
- TLS auth timeout by @mtmk in #339
- Log connection failure as warning by @jasper-d in #343
- pipe reader: don't mark commands as consumed until pending=0 by @caleblloyd in #347
- Async event handlers by @mnmr in #324
New Contributors
Full Changelog: v2.1.0-preview.2...v2.1.0-preview.4
Breaking changes
Event handlers
- Event handlers on connection object are now asynchronous and you would need to make code changes if you've been using them. Also one of the event's name has changed from 'OnError' to 'MessageDropped`:
nats.MessageDropped += async (_, e) =>
{
await File.AppendAllTextAsync("c:/tmp/log.txt", $"[DROP] {e.Subject}: {e.Data}\n");
};
- The way the events are dispatched has also changed to use a channel hence there maybe a delay receiving the event in your handlers.
See #324 for more details.
Other minor breaking changes
- Nullability review for models changed quite a few of the (mainly) JetStream model classes for better compiler support and developer experience. (#332)
- If you're relying on log severity on reconnect messages please check #343 for details as
Failed to connect NATS {Url}
messages are now logged as warnings instead of errors.
Note about release 2.1.0-preview.3
You might've notice we skipped announcing perview.3 release because of an issue (#341) we discovered which has now been fixed in #347 thanks to @caleblloyd.
Thank you
Big thanks to our contributors 🙏
Join our community chat rooms if you have any questions either on slack.nats.io dotnet channel or here on GitHub!
Don't forget to check out the documentation for guides and examples.
Additionally check out NATS by example - An evolving collection of runnable, cross-client reference examples for NATS.
Happy coding! ❤️
Nuget Packages
NATS.Net
This is the main meta package containing all other packages except serialization.
dotnet add package NATS.Net --version 2.1.0-preview.4
If you are not deploying Native AOT you can also use ad-hoc JSON serialization:
dotnet add package NATS.Client.Serializers.Json --version 2.1.0-preview.4
Individual Packages
dotnet add package NATS.Client.Core --version 2.1.0-preview.4
dotnet add package NATS.Client.Hosting --version 2.1.0-preview.4
dotnet add package NATS.Client.JetStream --version 2.1.0-preview.4
dotnet add package NATS.Client.KeyValueStore --version 2.1.0-preview.4
dotnet add package NATS.Client.ObjectStore --version 2.1.0-preview.4
dotnet add package NATS.Client.Services --version 2.1.0-preview.4
dotnet add package NATS.Client.Serializers.Json --version 2.1.0-preview.4