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

latest release: v3.0.0-preview.7
7 hours ago

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: v2.8.0...v2.8.1

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

Don't miss a new nats.net release

NewReleases is sending notifications on new releases.