From 01c3cf058bb33418acffc37371c9f968031cad7a Mon Sep 17 00:00:00 2001 From: Ziya Suzen Date: Thu, 9 Apr 2026 14:04:03 +0100 Subject: [PATCH 1/3] docs: improve package metadata and add README quick start Fix "persistance" typo in NuGet tags for JetStream, KeyValueStore, and ObjectStore packages. Expand terse package descriptions to full sentences that explain what each package does and what NATS is. Add richer NuGet tags (cloud-native, distributed, async, CNCF) across all packages to improve discoverability. Add a quick start guide and API-at-a-glance section to the README with working pub/sub examples. --- README.md | 67 +++++++++++++++++++ .../NATS.Client.Abstractions.csproj | 4 +- src/NATS.Client.Core/NATS.Client.Core.csproj | 4 +- .../NATS.Client.Hosting.csproj | 4 +- .../NATS.Client.JetStream.csproj | 4 +- .../NATS.Client.KeyValueStore.csproj | 4 +- .../NATS.Client.ObjectStore.csproj | 4 +- .../NATS.Client.Serializers.Json.csproj | 4 +- .../NATS.Client.Services.csproj | 4 +- .../NATS.Client.Simplified.csproj | 4 +- ...sions.Microsoft.DependencyInjection.csproj | 4 +- src/NATS.Net/NATS.Net.csproj | 4 +- 12 files changed, 89 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 14e1bf946..b90a37888 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,73 @@ async enumerables and channels, and leverages advanced .NET memory, buffer and I **Additionally check out [NATS by example](https://natsbyexample.com) - An evolving collection of runnable, cross-client reference examples for NATS.** +### Quick Start + +Start a NATS server: + +```shell +docker run -p 4222:4222 nats +``` + +Create a subscriber app: + +```shell +dotnet new console -n Sub && cd Sub && dotnet add package NATS.Net +``` + +```csharp +using NATS.Net; + +await using var nc = new NatsClient(); + +await foreach (var msg in nc.SubscribeAsync("greet")) + Console.WriteLine($"Received: {msg.Data}"); +``` + +In another terminal, create a publisher app: + +```shell +dotnet new console -n Pub && cd Pub && dotnet add package NATS.Net +``` + +```csharp +using NATS.Net; + +await using var nc = new NatsClient(); + +await nc.PublishAsync("greet", "Hello, NATS!"); +``` + +### API at a Glance + +```csharp +using NATS.Net; + +await using var nc = new NatsClient(); + +// Publish a message +await nc.PublishAsync("orders.new", new Order(Id: 1, Item: "widget")); + +// Subscribe with async enumerable +await foreach (var msg in nc.SubscribeAsync("orders.>")) + Console.WriteLine($"Received order: {msg.Data}"); + +// Request-reply +var reply = await nc.RequestAsync("orders.create", order); + +// JetStream (persistent messaging) +var js = nc.CreateJetStreamContext(); + +// Key/Value Store +var kv = nc.CreateKeyValueStoreContext(); + +// Object Store +var obj = nc.CreateObjectStoreContext(); + +// Services +var svc = nc.CreateServicesContext(); +``` + > [!NOTE] > **We are not testing with .NET 6.0 target anymore** even though it is still targeted by the library. > This is to reduce the number of test runs and speed up the CI process as well as to prepare for diff --git a/src/NATS.Client.Abstractions/NATS.Client.Abstractions.csproj b/src/NATS.Client.Abstractions/NATS.Client.Abstractions.csproj index fa1f67471..6ddef1fc0 100644 --- a/src/NATS.Client.Abstractions/NATS.Client.Abstractions.csproj +++ b/src/NATS.Client.Abstractions/NATS.Client.Abstractions.csproj @@ -2,8 +2,8 @@ - pubsub;messaging;abstractions - NATS client Abstractions for .NET + pubsub;messaging;abstractions;nats + Serialization abstractions and interfaces for the NATS .NET client library. diff --git a/src/NATS.Client.Core/NATS.Client.Core.csproj b/src/NATS.Client.Core/NATS.Client.Core.csproj index 0e92c9c54..d01e0e644 100644 --- a/src/NATS.Client.Core/NATS.Client.Core.csproj +++ b/src/NATS.Client.Core/NATS.Client.Core.csproj @@ -2,8 +2,8 @@ - pubsub;messaging - NATS core client for .NET + pubsub;messaging;cloud-native;distributed;async;real-time;CNCF;nats + Core client for NATS, the high-performance cloud-native messaging system. Provides async pub/sub, request-reply, and queue groups for .NET applications. diff --git a/src/NATS.Client.Hosting/NATS.Client.Hosting.csproj b/src/NATS.Client.Hosting/NATS.Client.Hosting.csproj index ae8ff3e2e..83f6128bc 100644 --- a/src/NATS.Client.Hosting/NATS.Client.Hosting.csproj +++ b/src/NATS.Client.Hosting/NATS.Client.Hosting.csproj @@ -2,8 +2,8 @@ - pubsub;messaging - ASP.NET Core and Generic Host support for NATS.Client. + pubsub;messaging;cloud-native;aspnetcore;hosting;nats + ASP.NET Core and Generic Host integration for the NATS .NET core client. Registers NatsConnection as a hosted service with dependency injection support. diff --git a/src/NATS.Client.JetStream/NATS.Client.JetStream.csproj b/src/NATS.Client.JetStream/NATS.Client.JetStream.csproj index 101707bad..ff36857b5 100644 --- a/src/NATS.Client.JetStream/NATS.Client.JetStream.csproj +++ b/src/NATS.Client.JetStream/NATS.Client.JetStream.csproj @@ -2,8 +2,8 @@ - pubsub;messaging;persistance - JetStream support for NATS.Client. + pubsub;messaging;persistence;streaming;cloud-native;distributed;CNCF;nats + JetStream persistent messaging for NATS .NET. Provides at-least-once delivery, stream management, and pull/push consumers for durable message processing. diff --git a/src/NATS.Client.KeyValueStore/NATS.Client.KeyValueStore.csproj b/src/NATS.Client.KeyValueStore/NATS.Client.KeyValueStore.csproj index 35689f22f..14fc2f4d7 100644 --- a/src/NATS.Client.KeyValueStore/NATS.Client.KeyValueStore.csproj +++ b/src/NATS.Client.KeyValueStore/NATS.Client.KeyValueStore.csproj @@ -2,8 +2,8 @@ - pubsub;messaging;persistance;key-value;storage - JetStream Key/Value Store support for NATS.Client. + pubsub;messaging;persistence;key-value;storage;cloud-native;distributed;CNCF;nats + Key/Value Store for NATS .NET, built on JetStream. Provides distributed key-value storage with watch, history, and TTL support. diff --git a/src/NATS.Client.ObjectStore/NATS.Client.ObjectStore.csproj b/src/NATS.Client.ObjectStore/NATS.Client.ObjectStore.csproj index 23b06a0dc..7babd0d46 100644 --- a/src/NATS.Client.ObjectStore/NATS.Client.ObjectStore.csproj +++ b/src/NATS.Client.ObjectStore/NATS.Client.ObjectStore.csproj @@ -2,8 +2,8 @@ - pubsub;messaging;persistance;storage - JetStream Object Store support for NATS.Client. + pubsub;messaging;persistence;storage;cloud-native;distributed;CNCF;nats + Object Store for NATS .NET, built on JetStream. Stores and retrieves large objects as chunked streams with metadata and integrity checks. diff --git a/src/NATS.Client.Serializers.Json/NATS.Client.Serializers.Json.csproj b/src/NATS.Client.Serializers.Json/NATS.Client.Serializers.Json.csproj index c62bc8412..44441e2cd 100644 --- a/src/NATS.Client.Serializers.Json/NATS.Client.Serializers.Json.csproj +++ b/src/NATS.Client.Serializers.Json/NATS.Client.Serializers.Json.csproj @@ -2,8 +2,8 @@ - pubsub;messaging - NATS client generic JSON serializer. Not suitable for native AOT deployments. + pubsub;messaging;json;serialization;nats + JSON serializer for NATS .NET using System.Text.Json. Supports ad-hoc types for quick prototyping. Not suitable for native AOT deployments. false false diff --git a/src/NATS.Client.Services/NATS.Client.Services.csproj b/src/NATS.Client.Services/NATS.Client.Services.csproj index 20cdbb434..ac567e39f 100644 --- a/src/NATS.Client.Services/NATS.Client.Services.csproj +++ b/src/NATS.Client.Services/NATS.Client.Services.csproj @@ -2,8 +2,8 @@ - pubsub;messaging;microservices;services - Service API support for NATS.Client. + pubsub;messaging;microservices;services;cloud-native;distributed;CNCF;nats + Services framework for NATS .NET. Build discoverable microservices with automatic health monitoring, stats, and endpoint management. diff --git a/src/NATS.Client.Simplified/NATS.Client.Simplified.csproj b/src/NATS.Client.Simplified/NATS.Client.Simplified.csproj index 14ac58089..f00e537ab 100644 --- a/src/NATS.Client.Simplified/NATS.Client.Simplified.csproj +++ b/src/NATS.Client.Simplified/NATS.Client.Simplified.csproj @@ -2,8 +2,8 @@ - pubsub;messaging - NATS simplified client for .NET + pubsub;messaging;cloud-native;distributed;async;nats + Simplified high-level API for NATS .NET. Wraps common pub/sub, request-reply, and JetStream patterns with sensible defaults for quick adoption. NATS.Net diff --git a/src/NATS.Extensions.Microsoft.DependencyInjection/NATS.Extensions.Microsoft.DependencyInjection.csproj b/src/NATS.Extensions.Microsoft.DependencyInjection/NATS.Extensions.Microsoft.DependencyInjection.csproj index f235a60cb..958310f71 100644 --- a/src/NATS.Extensions.Microsoft.DependencyInjection/NATS.Extensions.Microsoft.DependencyInjection.csproj +++ b/src/NATS.Extensions.Microsoft.DependencyInjection/NATS.Extensions.Microsoft.DependencyInjection.csproj @@ -2,8 +2,8 @@ - pubsub;messaging - ASP.NET Core and Generic Host support for NATS.Net. + pubsub;messaging;cloud-native;aspnetcore;hosting;dependency-injection;nats + Microsoft dependency injection extension for NATS .NET. Configures NatsClient with the Generic Host and ASP.NET Core service collection. diff --git a/src/NATS.Net/NATS.Net.csproj b/src/NATS.Net/NATS.Net.csproj index f06fb7a7a..45d1fa858 100644 --- a/src/NATS.Net/NATS.Net.csproj +++ b/src/NATS.Net/NATS.Net.csproj @@ -2,8 +2,8 @@ - pubsub;messaging - NATS client for modern .NET + pubsub;messaging;cloud-native;distributed;async;real-time;CNCF;nats + NATS .NET client for the NATS cloud-native messaging system. Includes Core NATS pub/sub, JetStream persistent messaging, Key/Value Store, Object Store, and Services. Built on async/await with support for .NET 8, .NET 6, and .NET Standard 2.0. From a426e99e606977a1fcaeefda270e48ac06e7e974 Mon Sep 17 00:00:00 2001 From: Ziya Suzen Date: Thu, 9 Apr 2026 14:21:22 +0100 Subject: [PATCH 2/3] docs: address review feedback on descriptions Fix Hosting description to say "service collection" instead of "hosted service" since NatsConnection is not an IHostedService. Remove JetStream mention from Simplified description since that package has no JetStream dependency. Declare order variable in the README API-at-a-glance snippet. --- README.md | 1 + src/NATS.Client.Hosting/NATS.Client.Hosting.csproj | 2 +- src/NATS.Client.Simplified/NATS.Client.Simplified.csproj | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b90a37888..6121608c4 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ await foreach (var msg in nc.SubscribeAsync("orders.>")) Console.WriteLine($"Received order: {msg.Data}"); // Request-reply +var order = new Order(Id: 2, Item: "gadget"); var reply = await nc.RequestAsync("orders.create", order); // JetStream (persistent messaging) diff --git a/src/NATS.Client.Hosting/NATS.Client.Hosting.csproj b/src/NATS.Client.Hosting/NATS.Client.Hosting.csproj index 83f6128bc..e36938aae 100644 --- a/src/NATS.Client.Hosting/NATS.Client.Hosting.csproj +++ b/src/NATS.Client.Hosting/NATS.Client.Hosting.csproj @@ -3,7 +3,7 @@ pubsub;messaging;cloud-native;aspnetcore;hosting;nats - ASP.NET Core and Generic Host integration for the NATS .NET core client. Registers NatsConnection as a hosted service with dependency injection support. + ASP.NET Core and Generic Host integration for the NATS .NET core client. Registers NatsConnection in the .NET Generic Host service collection. diff --git a/src/NATS.Client.Simplified/NATS.Client.Simplified.csproj b/src/NATS.Client.Simplified/NATS.Client.Simplified.csproj index f00e537ab..4f25a5240 100644 --- a/src/NATS.Client.Simplified/NATS.Client.Simplified.csproj +++ b/src/NATS.Client.Simplified/NATS.Client.Simplified.csproj @@ -3,7 +3,7 @@ pubsub;messaging;cloud-native;distributed;async;nats - Simplified high-level API for NATS .NET. Wraps common pub/sub, request-reply, and JetStream patterns with sensible defaults for quick adoption. + Simplified high-level API for NATS .NET. Wraps common pub/sub and request-reply patterns with sensible defaults for quick adoption. NATS.Net From fe6444b828c41ccd5bd04f3e26a01d74d5515917 Mon Sep 17 00:00:00 2001 From: Ziya Suzen Date: Thu, 9 Apr 2026 15:48:30 +0100 Subject: [PATCH 3/3] docs: include .NET Standard 2.1 in NATS.Net description --- src/NATS.Net/NATS.Net.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NATS.Net/NATS.Net.csproj b/src/NATS.Net/NATS.Net.csproj index 45d1fa858..088ff39ad 100644 --- a/src/NATS.Net/NATS.Net.csproj +++ b/src/NATS.Net/NATS.Net.csproj @@ -3,7 +3,7 @@ pubsub;messaging;cloud-native;distributed;async;real-time;CNCF;nats - NATS .NET client for the NATS cloud-native messaging system. Includes Core NATS pub/sub, JetStream persistent messaging, Key/Value Store, Object Store, and Services. Built on async/await with support for .NET 8, .NET 6, and .NET Standard 2.0. + NATS .NET client for the NATS cloud-native messaging system. Includes Core NATS pub/sub, JetStream persistent messaging, Key/Value Store, Object Store, and Services. Built on async/await with support for .NET 8, .NET 6, and .NET Standard 2.0/2.1.