github nats-io/nats.net v2.7.0
NATS .NET v2.7.0

9 hours ago

We are excited to announce a minor release of NATS .NET version 2.7.0 with a lot of fixes and improvements making NATS .NET client easier to use, testing friendly and more robust:

  • Improved OpenTelemetry support: Added filtering and enrichment for activities (#859)
  • JetStream publish improvements: Better retry defaults and consistent error handling
  • Dependency upgrades: All Microsoft.Extensions packages updated to .NET 8 (improves compatibility, security, and performance)
  • Abstractions package: Moved serialization interface into abstractions (#858) for better modularity/ We will move other interfaces to Abstractions gradually.

Important: Please note, there are also minor breaking changes which might affect dependent applications and sometimes transient dependencies. Application developers should recompile and test their application more rigorously in a non-production environment before deploying to production.

Breaking Changes

  • Timeout exceptions: Replaced OperationCanceledException with NatsTimeoutException for timeouts (previously surfaced as cancellations). Update any code catching OperationCanceledException for timeouts.

  • ReplyAsync on NatsJsMsg: Now marked [Obsolete]. Use the alternative method instead.

  • Serialization interface moved into abstractions: Via PR #858 ("Move Serialization Interface into Abstractions").

    • This is a structural refactor that relocates the serialization-related interface to a dedicated abstractions layer in the codebase.
    • Why it matters: It improves modularity, maintainability, and separation of concerns (e.g., making it easier to swap or extend serialization without touching core implementation).
    • Impact: This is not a breaking change for end-users (no API surface change is mentioned), but it could affect anyone building extensions or custom serializers that directly reference the old location.
    • Linked issue: #851
  • Fixed KV TTL interface handling (#854): This brings KV API inline with the design documents. It removed TTL parameters from update calls, which are problematic with buckets with history enabled.

New Features

  • OpenTelemetry activity filtering & enrichment
  • Improved JetStream publish retry behavior

Bug Fixes

  • Fixed KV TTL interface handling (#854)
  • Fixed connection state issues for consume, request, and reply (#856–858)
  • Improved timeout exception handling across client, JetStream, and consumer scenarios

What's Changed - Full List

New Contributors

Full Changelog: v2.6.14...v2.7.0

You can download the built packages from NuGet as usual: https://www.nuget.org/packages/NATS.Net/2.7.0

Last but not least, we thank all the contributors for taking the time to help out and making NATS .NET a great community project for the NATS ecosystem and the community. Thank you ❤️

Don't miss a new nats.net release

NewReleases is sending notifications on new releases.