Skip to content

chore(deps): Bump NATS.Net from 2.6.11 to 3.0.0#114

Closed
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/nuget/src/multi-8c8d5f10a2
Closed

chore(deps): Bump NATS.Net from 2.6.11 to 3.0.0#114
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/nuget/src/multi-8c8d5f10a2

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jul 13, 2026

Copy link
Copy Markdown
Contributor

Updated NATS.Net from 2.6.11 to 3.0.0.

Release notes

Sourced from NATS.Net's releases.

3.0.0

NuGet

NATS .NET 3.0 is now stable. This release has been in the works since early this year and brings OpenTelemetry tracing and metrics, .NET 10 target, and a number of API and behavior changes refined over the preview series. Thanks to everyone who tried the previews and reported issues along the way. There are no changes since 3.0.0-preview.11.

.NET 10 Target

3.0 targets netstandard2.0, netstandard2.1, net8.0, and net10.0. net6.0 has been dropped.

OpenTelemetry

API and behavior changes

Performance and internals

Tests and docs

Thanks

Thanks to the community for the contributions and issue reports behind this release:

  • @​colprog for the header handling optimization (#​1203), the custom span destination name formatter (#​1201), and requesting the explicit drain API (#​1176)
    ... (truncated)

3.0.0-preview.11

NuGet

Last planned preview on the 3.0 line centered on OpenTelemetry: a new NATS.Client.OpenTelemetry package, richer metrics, and lower-overhead tracing. Also moves the socket connection interfaces into NATS.Client.Abstractions and tightens the header-parsing hot path.

OpenTelemetry:

  • Add OpenTelemetry package (#​1172)
  • Add custom span destination name formatter (#​1201)
  • Add ack/dropped metrics and collapse inbox trace tags (#​1194)
  • Exclude NATS status frames from consumed metrics (#​1195)
  • Make shared instrumentation options thread-visible (#​1207)
  • Match subject filters without per-message allocation (#​1206)
  • Fix null-key tag in receive fallback (#​1205)

Core & packaging:

  • Move socket connection interfaces to NATS.Client.Abstractions (#​1192)
  • Add abstractions package boundary test (#​1197)
  • Optimize header handling with SearchValues (#​1203)
  • Simplify object store base64url encoder (#​1199)
  • Gate positive-path test connections with ConnectRetryAsync (#​1198)
  • Remove stale net6.0 references (#​1196)

Thanks to @​colprog for the custom span destination name formatter (#​1201) and the SearchValues header optimization (#​1203).

Thanks to everyone testing the previews so far. This should be the last one; please give it one more round of testing, and if no bugs turn up we'll cut the stable 3.0 release in about a week.

Full Changelog: nats-io/nats.net@v3.0.0-preview.10...v3.0.0-preview.11

3.0.0-preview.10

NuGet

Bug-fix preview on the 3.0 line. Carries the ordered push consumer subscription teardown fixes from the 2.x line; no 3.0-only changes this round.

From the 2.x line:

  • jetstream: simplify ordered push consumer sub teardown (#​1191)
  • jetstream: dispose ordered push consumer sub on teardown (#​1188)

Full Changelog: nats-io/nats.net@v3.0.0-preview.9...v3.0.0-preview.10

3.0.0-preview.9

NuGet

Ninth preview of NATS .NET 3.0. Request-reply now defaults to Direct mode, and subscriptions and consumers can be drained explicitly.

Heads-up: the default request-reply mode is now NatsRequestReplyMode.Direct (previously SharedInbox). Direct uses the same inbox prefix but skips per-reply muxer processing, making RequestAsync more resource-efficient. At the default it still throws NatsNoRespondersException on a no-responders reply, so existing RequestAsync behavior is preserved. If you already set RequestReplyMode explicitly to either mode, nothing changes for you. To keep the old default mechanism, set NatsOpts.RequestReplyMode = NatsRequestReplyMode.SharedInbox.

3.0-only changes:

  • Default request-reply to Direct mode (#​1182)
  • Add explicit subscription and consumer drain (#​1177)
  • Unify subscription channel overflow defaults (#​1181)
  • Deprecate SkipSubjectValidation (#​1180)
  • Fix OTel server.port tag type and source (#​1175)

Also from the 2.x line:

  • Bump MessagePack 3.1.1 -> 3.1.7 (#​1183)

Full Changelog: nats-io/nats.net@v3.0.0-preview.8...v3.0.0-preview.9

3.0.0-preview.8

NuGet

Eighth preview of NATS .NET 3.0. Adds OpenTelemetry metrics support.

3.0-only changes:

  • Add OTel metrics support (#​1154)

Thanks to @​divyeshio (#​629) and @​thompson-tomo (#​871) for earlier work toward OTel metrics, and @​aradalvand for the OpenTelemetry tracing groundwork (#​859, #​907, #​911) this builds on. Long-requested feature (#​316); thanks also to @​Cooksauce and @​iby-dev for weighing in along the way.

Full Changelog: nats-io/nats.net@v3.0.0-preview.7...v3.0.0-preview.8

3.0.0-preview.7

NuGet

Seventh preview of NATS .NET 3.0. Brings in everything released in 2.8.1: a Services helper for detecting error responses on the requester side, plus bug fixes across JetStream, KV, subscriptions, and connection logging. No 3.0-only changes.

From main (via 2.8.1):

  • Add helpers to detect Nats-Service-Error on responses (#​1152)
  • Fix durable consumer create when only DurableName is set (#​1150)
  • kv: cap duplicate_window at max_age (#​1149)
  • Quiet recoverable server-error logs (#​1148) (thanks @​garrett-sutton)
  • Fix subscription timeout overflow (#​1134) (thanks @​Prochy)
  • test: fix Windows CI flaps (#​1147)
  • docs: add JetStream basic example (#​1138)

Full Changelog: nats-io/nats.net@v3.0.0-preview.6...v3.0.0-preview.7

3.0.0-preview.6

NuGet

Sixth preview of NATS .NET 3.0. Brings in everything merged to main since preview.5: a new server error event on NatsConnection, slnx solution-format migration, README and example docs additions, and a CI matrix bump to nats-server v2.12. No 3.0-only changes.

From main:

  • Add server error event (#​745)
  • Migrate solution to slnx format (#​1131)
  • Add Client and Orbit section to README (#​1133)
  • Add Example Docs (#​1119)
  • ci: test against v2.12, drop v2.10 (#​1136)

Full Changelog: nats-io/nats.net@v3.0.0-preview.5...v3.0.0-preview.6

3.0.0-preview.5

NuGet

Fifth preview of NATS .NET 3.0. Brings in everything from 2.8.0-preview.3 via a main sync (nats-server 2.14 features and a fix for in-flight message loss on consumer dispose). No 3.0-only changes since preview.4.

From main (also in 2.8.0-preview.3):

  • Add consumer reset API (#​1126, server 2.14)
  • Add $JS.FC support to JS metadata parser (#​1127, server 2.14)
  • Add consumer field on stream source/mirror (#​1128, server 2.14)
  • Fix message loss on consumer dispose (#​1085)

Full Changelog: nats-io/nats.net@v3.0.0-preview.4...v3.0.0-preview.5

3.0.0-preview.4

NuGet

Fourth preview of NATS .NET 3.0 ships nats-server v2.14 support: streams that opt into fast-ingest batch publishing per ADR-50 can now set the new AllowBatchPublish field on StreamConfig (the fast-ingest publisher itself will live in orbit.net alongside the existing atomic batch publisher). Also brings in everything from 2.8.0-preview.2 via the main sync, and switches to System.Threading.Lock on net9.0+ on the 3.0 line.

3.0-only since preview.3:

  • Use System.Threading.Lock on NET9_0_OR_GREATER (#​1118)

From main (also in 2.8.0-preview.2):

  • Add AllowBatchPublish stream config field (#​1120)
  • Bump OpenTelemetry and OpenTelemetry.Exporter.OpenTelemetryProtocol (#​1121)
  • Fix setting wrong pin id from status header (#​1116) (thanks @​colprog)
  • Fix slow-consumer test first-ping RTT flap (#​1115)
  • Fix net481 TLS test flakes (#​1111)
  • Rewrite README intro (#​1114)

Full Changelog: nats-io/nats.net@v3.0.0-preview.3...v3.0.0-preview.4

3.0.0-preview.3

Preview release on the 3.0 line. Brings in everything from 2.8.0-preview.1 via the main syncs, plus context-aware serialization. Three breaking changes in total, all intentional on the preview channel before stable 3.0. Please try it and report anything odd.

Package on NuGet: https://www.nuget.org/packages/NATS.Net

Breaking changes:

  • Subject validation is on by default. Subjects containing whitespace (space, tab, CR, LF) now throw. Opt out with SkipSubjectValidation = true on NatsOpts. Closes a class of CRLF injection issues from malformed subjects.
  • NATS.Client.Core.NKeys and NKeyPair are removed. Signing now goes through the NATS.NKeys package (https://www.nuget.org/packages/NATS.NKeys), which lets the nkey/Ed25519 code be versioned independently of the client.
  • Serializers that want access to message context during (de)serialization opt in via the new INatsSerializeWithContext<T> / INatsDeserializeWithContext<T> interfaces (or the combined INatsSerializerWithContext<T>). Existing serializers keep working unchanged; the library dispatches via runtime type check and falls back to the standard interface. Built-in serializers propagate the context through chains. The read-only flag on NatsHeaders is removed so context-aware serializers can mutate headers; a single NatsHeaders instance is no longer safe to share across concurrent publishes.

Also includes protocol size checks (64MB incoming payload cap, in line with nats.js), KV watcher cancellation fix, credential loading state reset on failure, and Pin ID handling improvements.

Thanks to the NATS community who contributed PRs, reviews, bug reports on this one ❤️

3.0-only since preview.2:

  • Add message context to serialization interfaces (#​1082) [breaking] (thanks @​adminnz)

From main (also in 2.8.0-preview.1):

  • auth: sign nonce regardless of auth_required (#​1109) (thanks @​Lionel-Zieminski)
  • auth: use NATS.NKeys package for nkey signing (#​1101) [breaking]
  • conn: reset state on credential loading failure (#​1107) (thanks @​Prochy)
  • Improve package metadata and README (#​1103)
  • tests: fix TlsPreferTest flap on net481 (#​1108)
  • Fix release workflow (#​1106)
  • Fix test flaps (#​1083)
  • ci: add contents and actions read permissions to Claude workflow (#​1102)
  • tls: document Prefer mode plaintext behavior (#​1094)
  • tests: increase NuidTests thread join timeouts (#​1100)
  • Improve Pin ID handling (#​1099) (thanks @​colprog)
  • Fix KV watcher cancellation behavior (#​1084)
  • Clear ArrayPool buffers before returning to pool (#​1097)
  • Enable subject validation by default (#​1093) [breaking]
  • Add protocol size checks (#​1095)
  • Fix Range attribute for MaxBytes property (#​1096) (thanks @​partnerRuiSilva)
  • Add CC reviews (#​1092)

Full Changelog: nats-io/nats.net@v3.0.0-preview.2...v3.0.0-preview.3

3.0.0-preview.2

This is a main branch sync release.

Please see 2.7.3 release for details.

What's Changed

Full Changelog: nats-io/nats.net@v3.0.0-preview.1...v3.0.0-preview.2

2.8.2

NuGet

Patch release on the 2.8 line. Fixes ordered push consumer subscription teardown. Thanks to @​haoguanjun for the fix.

What's Changed

Full Changelog: nats-io/nats.net@v2.8.1...v2.8.2

2.8.1

NuGet

Patch release on the 2.8 line. Bug fixes across JetStream, KV, subscriptions, and connection logging, plus a small Services helper for handling error responses on the requester side.

What's Changed

  • Add helpers to detect Nats-Service-Error on responses (#​1152)
  • Fix durable consumer create when only DurableName is set (#​1150)
  • kv: cap duplicate_window at max_age (#​1149)
  • Quiet recoverable server-error logs (#​1148) (thanks @​garrett-sutton)
  • Fix subscription timeout overflow (#​1134) (thanks @​Prochy)
  • test: fix Windows CI flaps (#​1147)
  • docs: add JetStream basic example (#​1138)

New Services Extensions

Detect service errors on responses (#​1152)

Services signal failures using Nats-Service-Error / Nats-Service-Error-Code response headers. The requester side previously had to read those headers by hand. New extensions on NatsMsg<T> (in the NATS.Net namespace) cover the common patterns:

var reply = await nats.RequestAsync<MyReq, MyResp>("svc.echo", req);

if (reply.IsServiceSuccess())
{
    // use reply.Data
}

// or throw on error
reply.EnsureServiceSuccess();

// or inspect the status
var status = reply.GetServiceStatus();
// status.IsSuccess, status.Code, status.Message, status.HasNoResponders

Full Changelog: nats-io/nats.net@v2.8.0...v2.8.1

Download from NuGet at https://www.nuget.org/packages/NATS.Net/2.8.1

2.8.0

NuGet

Happy to announce the NATS .NET 2.8.0 stable release of the 2.8 line. It picks up the NATS Server v2.14 client surface (consumer reset, $JS.FC.* flow-control replies, Consumer field on stream source/mirror, AllowBatchPublish on stream config), ships two breaking changes that landed in the preview cycle, and fixes in-flight message loss on consumer/connection dispose behind an opt-in drain.

A big thank you to all NATS contributors and community members who helped make this release possible. <3

NATS Server v2.14 Features

  • ResetConsumerAsync on INatsJSContext and INatsJSConsumer (ADR-60), to reset a pinned consumer's state (#​1126).
  • $JS.FC.* flow-control replies are parsed by the JS metadata layer, for streams that publish with the js_ack_fc_v2 flag (#​1127).
  • Consumer field on StreamSource and stream mirror config, for pre-created mirror/source consumers (#​1128).
  • AllowBatchPublish on StreamConfig (JSON allow_batched), required by streams that opt into fast-ingest batch publishing per ADR-50 (#​1120). The fast-ingest publisher itself lives in orbit.net alongside the existing atomic batch publisher.

Breaking Changes

Subject Validation On By Default (#​1093)

Subjects containing whitespace (space, tab, CR, LF) now throw NatsException. This closes a class of CRLF injection issues from malformed subjects.

Opt out if you rely on legacy subjects that contain whitespace:

var opts = NatsOpts.Default with { SkipSubjectValidation = true };

NKeyPair Removed From NATS.Client.Core (#​1101)

NATS.Client.Core.NKeys and NKeyPair are removed. Signing now goes through the NATS.NKeys package, which lets the nkey/Ed25519 code be versioned independently of the client.

For typical users this is transparent: keep using NatsAuthOpts.NKeyFile, CredsFile, Jwt + Seed, or AuthCredCallback and the client wires up the new signer automatically.

Only direct callers of NATS.Client.Core.NKeyPair need to switch:

// Before
using NATS.Client.Core;
var kp = NKeyPair.FromSeed(seed);
var sig = kp.Sign(nonce);

// After
using NATS.NKeys;
var kp = KeyPair.FromSeed(seed);
var sig = kp.Sign(nonce);

Other Notable Changes

  • Server error event (#​745): a new event on NatsConnection surfaces server-side errors to client code.
  • Message loss on consumer dispose (#​1085): opt-in drain keeps in-flight messages from being dropped when a consumer or connection is disposed. Enable with:

... (truncated)

2.8.0-preview.3

NuGet

Third preview of NATS .NET 2.8 completes the nats-server v2.14 feature set for the client. See PRs below for specifics.

This release also includes a fix for in-flight message loss on consumer/connection dispose. The new drain path is opt-in, so defaults preserve current behavior. The dispose ordering refactor touches a hot path though, so please give your workloads a once-over and report anything that looks off.

Opt in:

var opts = NatsOpts.Default with
{
    DrainSubscriptionsOnDispose = true,
    ConsumerDrainOnDisposeTimeout = TimeSpan.FromSeconds(10),
};

Changes:

  • Add consumer reset API (#​1126)
  • Add $JS.FC support to JS metadata parser (#​1127)
  • Add consumer field on stream source/mirror (#​1128)
  • Fix message loss on consumer dispose (#​1085)

Full Changelog: nats-io/nats.net@v2.8.0-preview.2...v2.8.0-preview.3

2.8.0-preview.2

NuGet

Second preview of NATS .NET 2.8 ships nats-server v2.14 support: streams that opt into fast-ingest batch publishing per ADR-50 can now set the new AllowBatchPublish field on StreamConfig (the fast-ingest publisher itself will live in orbit.net alongside the existing atomic batch publisher). Also picks up a Pin ID handling fix for duplicate status headers, the new flat README intro, and assorted CI and test flake fixes.

Changes:

  • Add AllowBatchPublish stream config field (#​1120)
  • Bump OpenTelemetry and OpenTelemetry.Exporter.OpenTelemetryProtocol (#​1121)
  • Fix setting wrong pin id from status header (#​1116) (thanks @​colprog)
  • Fix slow-consumer test first-ping RTT flap (#​1115)
  • Fix net481 TLS test flakes (#​1111)
  • Rewrite README intro (#​1114)

Full Changelog: nats-io/nats.net@v2.8.0-preview.1...v2.8.0-preview.2

2.8.0-preview.1

Happy to ship the first preview of NATS .NET 2.8. The theme of this release is tightening the protocol layer and shrinking the core API surface, so this preview carries two breaking changes. Please try it and report anything odd before we cut the stable.

Package on NuGet: https://www.nuget.org/packages/NATS.Net

Breaking changes:

  • Subject validation is on by default. Subjects containing whitespace (space, tab, CR, LF) now throw. This closes a class of CRLF injection issues from malformed subjects. Opt out with SkipSubjectValidation = true on NatsOpts.
  • NATS.Client.Core.NKeys and NKeyPair are removed. Signing now goes through the NATS.NKeys package (https://www.nuget.org/packages/NATS.NKeys), which lets the nkey/Ed25519 code be versioned independently of the client.

Also includes protocol size checks (64MB incoming payload cap, in line with nats.js), KV watcher cancellation fix, credential loading state reset on failure, and Pin ID handling improvements.

Thanks to the NATS community who contributed PRs, reviews, and bug reports on this one ❤️

  • auth: sign nonce regardless of auth_required (#​1109) (thanks @​Lionel-Zieminski)
  • auth: use NATS.NKeys package for nkey signing (#​1101) [breaking]
  • conn: reset state on credential loading failure (#​1107) (thanks @​Prochy)
  • Improve package metadata and README (#​1103)
  • tests: fix TlsPreferTest flap on net481 (#​1108)
  • Fix release workflow (#​1106)
  • Fix test flaps (#​1083)
  • ci: add contents and actions read permissions to Claude workflow (#​1102)
  • tls: document Prefer mode plaintext behavior (#​1094)
  • tests: increase NuidTests thread join timeouts (#​1100)
  • Improve Pin ID handling (#​1099) (thanks @​colprog)
  • Fix KV watcher cancellation behavior (#​1084)
  • Clear ArrayPool buffers before returning to pool (#​1097)
  • Enable subject validation by default (#​1093) [breaking]
  • Add protocol size checks (#​1095)
  • Fix Range attribute for MaxBytes property (#​1096) (thanks @​partnerRuiSilva)
  • Add CC reviews (#​1092)

Full Changelog: nats-io/nats.net@v2.7.3...v2.8.0-preview.1

2.7.3

Announcing a new version of NATS .NET client library covering various fixes and a security update on one dependency for NETStandard targets (#​1089) even though the vulnerable API is not used by our library.

A big thank you to all NATS contributors and community members who helped make this release possible ❤️

Breaking Changes

NakAsync Signature Change (#​1081)

The TimeSpan delay parameter has been removed from INatsJSMsg<T>.NakAsync(). The delay must now be passed via AckOpts.NakDelay.

Before (v2.7.2):

await msg.NakAsync(delay: TimeSpan.FromSeconds(5));
await msg.NakAsync(opts, TimeSpan.FromSeconds(5));

After (v2.7.3):

// Option 1: Use the new extension method
await msg.NakAsync(TimeSpan.FromSeconds(5));

// Option 2: Use AckOpts with NakDelay
await msg.NakAsync(new AckOpts { NakDelay = TimeSpan.FromSeconds(5) });

Note: because we also have an extension method, recompiling your project is enough.

AckTerminateAsync TermWithReason (#​1048, #​1081)

AckTerminateAsync now supports an optional termination reason. A new overload and a new TerminateReason property on AckOpts have been added to INatsJSMsg<T>. Implementors of this interface must add the new method.

// New overload
await msg.AckTerminateAsync("processing failed permanently");

// Or via AckOpts
await msg.AckTerminateAsync(new AckOpts { TerminateReason = "processing failed permanently" });

// Extension method shorthand
await msg.AckTerminateAsync("reason", cancellationToken);

Requires NATS Server 2.10.4+.

PinnedClient Validation (#​1063)

Calling NextAsync(), FetchAsync(), or FetchNoWaitAsync() on a consumer with PriorityPolicy.PinnedClient now throws NatsJSException. Use ConsumeAsync() instead.

// This now throws NatsJSException:
 ... (truncated)

## 2.7.2

Excited to announce a new patch release of NATS .NET client library version 2.7.2 with an important fix to slow consumers improving reliability and performance.

Please see [Preview 1](https://github.com/nats-io/nats.net/releases/tag/v2.7.2-preview.1) release notes for details.

Additionally added `SlowConsumerDetected` event and logging to make sure applications will be aware of he slow consumers and can look into adjusting channel size or application logic to handle slow message processors when identified.

We also have lots of other minor and important fixes and improvements. Please see the full list below.

## What's Changed

Preview 1:
* Add API Compat for TFMs by @​mtmk in https://github.com/nats-io/nats.net/pull/1033
* Fix slow consumer blocking by @​mtmk in https://github.com/nats-io/nats.net/pull/1041
* resolves: 1035 - Use ConnectTimeout when awaiting INFO signal by @​ptsteward in https://github.com/nats-io/nats.net/pull/1039

Preview 2:
* FIXED unobserved exceptions surfacing due to unobserved tcs. by @​me064 in https://github.com/nats-io/nats.net/pull/1051
* Add SlowConsumerDetected event and warnings by @​mtmk in https://github.com/nats-io/nats.net/pull/1052
* Fix subject encoding to use UTF-8 per NATS protocol spec by @​aafloy in https://github.com/nats-io/nats.net/pull/1054
* Fix OTel activity leak in Direct request mode by @​aradalvand in https://github.com/nats-io/nats.net/pull/1047

In this release: 
* Fix NatsUri not reflecting host/port changes from OnConnectingAsync hook by @​tormoder in https://github.com/nats-io/nats.net/pull/997
* Fix StreamSourceInfo.Active handle -1 correctly by @​paagamelo2 in https://github.com/nats-io/nats.net/pull/1058

## New Contributors
* @​ptsteward made their first contribution in https://github.com/nats-io/nats.net/pull/1039
* @​me064 made their first contribution in https://github.com/nats-io/nats.net/pull/1051
* @​tormoder made their first contribution in https://github.com/nats-io/nats.net/pull/997

**Full Changelog**: https://github.com/nats-io/nats.net/compare/v2.7.1...v2.7.2

Huge thank you to our community for helping with this release ❤️ 

Download from NuGet https://www.nuget.org/packages/NATS.Net/2.7.2

## 2.7.2-preview.2

This is another bug fix preview release possibly last before a stable 2.7.2 release. Please test this release as much as you can and provide feedback. Thank you.

## What's Changed
* FIXED unobserved exceptions surfacing due to unobserved tcs. by @​me064 in https://github.com/nats-io/nats.net/pull/1051
* Add SlowConsumerDetected event and warnings by @​mtmk in https://github.com/nats-io/nats.net/pull/1052
* Fix subject encoding to use UTF-8 per NATS protocol spec by @​aafloy in https://github.com/nats-io/nats.net/pull/1054
* Fix OTel activity leak in Direct request mode by @​aradalvand in https://github.com/nats-io/nats.net/pull/1047

## New Contributors
* @​me064 made their first contribution in https://github.com/nats-io/nats.net/pull/1051
* @​aafloy  made their first contribution in https://github.com/nats-io/nats.net/pull/1054

**Full Changelog**: https://github.com/nats-io/nats.net/compare/v2.7.2-preview.1...v2.7.2-preview.2

Huge thanks to our contributors and the awesome NATS community ❤️ 

Download from NuGet at https://www.nuget.org/packages/NATS.Net/2.7.2-preview.2

## 2.7.2-preview.1

This is a preview release of NATS .NET version 2.7.2 fixing an important slow consumer issue as well as timeout option correction.

## What's Changed
* Fix slow consumer blocking by @​mtmk in https://github.com/nats-io/nats.net/pull/1041
* resolves: 1035 - Use ConnectTimeout when awaiting INFO signal by @​ptsteward in https://github.com/nats-io/nats.net/pull/1039

## Slow Consumer Fix
Although we are happy that we believe slow consumer fix will solve a lot of the performance issues under load, please test this release as much as you can since there maybe behavioral changes that might affect your application. Please see #​1041 for more information.

Here are suggested changes after upgrading to 2.7.2-preview.1 or above:

### Observing Slow Consumer Events
In NATS .NET you can watch for slow consumer events by subscribing to `MessageDropped` event on the `INatsConnection` object and set the internal channel capacity using the `SubPendingChannelCapacity` option:

```csharp
await using var client = new NatsClient(
    opts : new NatsOpts
    {
        // Default is 1024, however, this may be too small for
        // high throughput scenarios. 16K is more reasonable for these cases.
        // Tradeoff is more memory usage especially because over 1024 messages
        // the backing array will be allocated on the LOH (large object heap).
        SubPendingChannelCapacity = 16384,
    },

    // This option may be deprecated in the future and set to DropNewest by default
    pending: BoundedChannelFullMode.DropNewest); 

client.Connection.MessageDropped += (sender, args) =>
{
    Console.WriteLine($"Message dropped. Subject:{args.Subject} Pending:{args.Pending}");
    return default;
};

Trade-offs of SubPendingChannelCapacity

Setting Pros Cons
Lower capacity (1024) Avoids LOH allocations Higher chance of message drops under load
Higher capacity (16384) Handles burst traffic better More memory usage, potential LOH allocations

You should watch LOH memory usage and slow consumer events using MessageDropped handler.

Also note that channel doesn't allocate this immediately. The backing array grows twice as much each time there is need for more space.

Differences between NatsClient and NatsConnection

NatsClient sets SubPendingChannelFullMode option to BoundedChannelFullMode.Wait by default which means you won't take advantage of this fix if you're using NatsClient to setup your connection.

If you are using NatsClient this fix won't affect your applications.
... (truncated)

2.7.1

This is a patch fix release for NATS .NET client fixing breaking changes introduced in the previous minor release. With this release errors with transient dependencies that are referencing older versions of the client are corrected by using type forwarding since we moved serialization interfaces to a new 'Abstractions' assembly. We are planning to more other interfaces into the Abstractions assembly and we will make sure the type forwards are in place for those. We also had a fix for an OTel extension due to moving return types to interfaces.

What's Changed

Full Changelog: nats-io/nats.net@v2.7.0...v2.7.1

Big thanks to @​caleblloyd and @​heikkilamarko for their help finding and fixing these issues for everyone.

You can download this release from NuGet as usual: https://www.nuget.org/packages/NATS.Net/2.7.1

2.7.0

⚠️ This release might create issues with transient dependencies because serialization interfaces are moved to different assemblies. Please use 2.7.1 or later versions where this was fixed with type forwarding.

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

2.7.0-preview.8

This is a bug fix and main merge release.

What's Changed

Full Changelog: nats-io/nats.net@v2.7.0-preview.7...v2.7.0-preview.8

Download from NuGet at https://www.nuget.org/packages/NATS.Net/2.7.0-preview.8

2.7.0-preview.7

This release aligns with the stable 2.6.10 release supporting new NATS Server version 2.12 features.

What's Changed

Full Changelog: nats-io/nats.net@v2.7.0-preview.6...v2.7.0-preview.7

Download from NuGet https://www.nuget.org/packages/NATS.Net/2.7.0-preview.7

2.7.0-preview.5

This release brings 2.7.x branch inline with main. There are important bug fixes. See release notes for 2.6.8 for details.

What's Changed

New Contributors

Full Changelog: nats-io/nats.net@v2.7.0-preview.4...v2.7.0-preview.5

Packages can be downloaded from NuGet: https://www.nuget.org/packages/NATS.Net/2.7.0-preview.5

2.7.0-preview.4

This is a patch preview release of NAT .NET client fixing a dispose and a consumer bug as well as providing corrections and improvements to interfaces.

What's Changed

New Contributors

Full Changelog: nats-io/nats.net@v2.7.0-preview.3...v2.7.0-preview.4

2.7.0-preview.3

Bug fix release and merges from main.

What's Changed

Full Changelog: nats-io/nats.net@v2.7.0-preview.2...v2.7.0-preview.3

2.7.0-preview.1

This is a new preview release with new features like the new Abstractions package.

What's Changed

New Contributors

Full Changelog: nats-io/nats.net@v2.6.4...v2.7.0-preview.1

2.6.14

This is a bugfix release with a small but important Subject Validation feature. Subject validation is turned of by default and can be enabled in NatsOpts. It will be enabled by default in a couple of releases down the line, so if you can, please enable it as soon as possible to make sure your applications are not affected. Subject validation makes sure subjects does not have whitespace characters as to not break the wire protocol. Placing spaces in subjects is not valid and well known. We do not expect the new subject validation feature to break any applications. Only being careful here. See #​1017 for more details.

What's Changed

Full Changelog: nats-io/nats.net@v2.6.12...v2.6.14

Packages can be downloaded from NuGet as usual: https://www.nuget.org/packages/NATS.Net/2.6.14

2.6.12

Happy to announce we have a new release of NATS .NET client library version 2.6.12. With this version we are providing several minor bug fixes and improvements as well as a couple of new features we missed out in our previous release supporting NATS Server 2.12: Support for Nats-Expected-Last-Subject-Sequence-Subject header #​1007 and prioritized mode #​1011.

Big thank you to our community for helping us with this release and to our contributors taking time to improve NATS .NET for everyone ❤️

What's Changed

New Contributors

Full Changelog: nats-io/nats.net@v2.6.11...v2.6.12

You can download the packages from NuGet: https://www.nuget.org/packages/NATS.Net/2.6.12

Commits viewable in compare view.

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

---
updated-dependencies:
- dependency-name: NATS.Net
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: NATS.Net
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot @github

dependabot Bot commented on behalf of github Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Labels

The following labels could not be found: nuget. Please create it before Dependabot can add it to a pull request.

Please fix the above issues or remove invalid values from dependabot.yml.

@github-actions

Copy link
Copy Markdown

⚠️ This is a major version update that may contain breaking changes. Please review carefully before merging.

@dependabot @github

dependabot Bot commented on behalf of github Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #118.

@dependabot dependabot Bot closed this Jul 20, 2026
@dependabot
dependabot Bot deleted the dependabot/nuget/src/multi-8c8d5f10a2 branch July 20, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants