github nats-io/nats.net v2.1.0-preview.4
NATS.Net v2.1.0-preview.4

latest releases: v2.5.4, v2.5.3, v2.5.2...
pre-release10 months ago

This is a NATS.Net bug fix release version 2.1.0-preview.4.

What's Changed

New Contributors

  • @mnmr made their first contribution in #332

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

Don't miss a new nats.net release

NewReleases is sending notifications on new releases.