Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,74 @@ 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<string>("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();
Comment thread
mtmk marked this conversation as resolved.

// 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<Order>("orders.>"))
Console.WriteLine($"Received order: {msg.Data}");

// Request-reply
var order = new Order(Id: 2, Item: "gadget");
var reply = await nc.RequestAsync<Order, Confirmation>("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
Expand Down
4 changes: 2 additions & 2 deletions src/NATS.Client.Abstractions/NATS.Client.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<!-- NuGet Packaging -->
<PackageTags>pubsub;messaging;abstractions</PackageTags>
<Description>NATS client Abstractions for .NET</Description>
<PackageTags>pubsub;messaging;abstractions;nats</PackageTags>
<Description>Serialization abstractions and interfaces for the NATS .NET client library.</Description>
</PropertyGroup>

<!-- Dependencies for all -->
Expand Down
4 changes: 2 additions & 2 deletions src/NATS.Client.Core/NATS.Client.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<!-- NuGet Packaging -->
<PackageTags>pubsub;messaging</PackageTags>
<Description>NATS core client for .NET</Description>
<PackageTags>pubsub;messaging;cloud-native;distributed;async;real-time;CNCF;nats</PackageTags>
<Description>Core client for NATS, the high-performance cloud-native messaging system. Provides async pub/sub, request-reply, and queue groups for .NET applications.</Description>
</PropertyGroup>

<!-- Dependencies for all -->
Expand Down
4 changes: 2 additions & 2 deletions src/NATS.Client.Hosting/NATS.Client.Hosting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<!-- NuGet Packaging -->
Comment thread
mtmk marked this conversation as resolved.
<PackageTags>pubsub;messaging</PackageTags>
<Description>ASP.NET Core and Generic Host support for NATS.Client.</Description>
<PackageTags>pubsub;messaging;cloud-native;aspnetcore;hosting;nats</PackageTags>
<Description>ASP.NET Core and Generic Host integration for the NATS .NET core client. Registers NatsConnection in the .NET Generic Host service collection.</Description>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net8.0'">
Expand Down
4 changes: 2 additions & 2 deletions src/NATS.Client.JetStream/NATS.Client.JetStream.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<!-- NuGet Packaging -->
<PackageTags>pubsub;messaging;persistance</PackageTags>
<Description>JetStream support for NATS.Client.</Description>
<PackageTags>pubsub;messaging;persistence;streaming;cloud-native;distributed;CNCF;nats</PackageTags>
<Description>JetStream persistent messaging for NATS .NET. Provides at-least-once delivery, stream management, and pull/push consumers for durable message processing.</Description>
</PropertyGroup>

<!-- Dependencies for prior to net5.0-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<!-- NuGet Packaging -->
<PackageTags>pubsub;messaging;persistance;key-value;storage</PackageTags>
<Description>JetStream Key/Value Store support for NATS.Client.</Description>
<PackageTags>pubsub;messaging;persistence;key-value;storage;cloud-native;distributed;CNCF;nats</PackageTags>
<Description>Key/Value Store for NATS .NET, built on JetStream. Provides distributed key-value storage with watch, history, and TTL support.</Description>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/NATS.Client.ObjectStore/NATS.Client.ObjectStore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<!-- NuGet Packaging -->
<PackageTags>pubsub;messaging;persistance;storage</PackageTags>
<Description>JetStream Object Store support for NATS.Client.</Description>
<PackageTags>pubsub;messaging;persistence;storage;cloud-native;distributed;CNCF;nats</PackageTags>
<Description>Object Store for NATS .NET, built on JetStream. Stores and retrieves large objects as chunked streams with metadata and integrity checks.</Description>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<!-- NuGet Packaging -->
<PackageTags>pubsub;messaging</PackageTags>
<Description>NATS client generic JSON serializer. Not suitable for native AOT deployments.</Description>
<PackageTags>pubsub;messaging;json;serialization;nats</PackageTags>
<Description>JSON serializer for NATS .NET using System.Text.Json. Supports ad-hoc types for quick prototyping. Not suitable for native AOT deployments.</Description>

<IsTrimmable>false</IsTrimmable>
<IsAotCompatible>false</IsAotCompatible>
Expand Down
4 changes: 2 additions & 2 deletions src/NATS.Client.Services/NATS.Client.Services.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<!-- NuGet Packaging -->
<PackageTags>pubsub;messaging;microservices;services</PackageTags>
<Description>Service API support for NATS.Client.</Description>
<PackageTags>pubsub;messaging;microservices;services;cloud-native;distributed;CNCF;nats</PackageTags>
<Description>Services framework for NATS .NET. Build discoverable microservices with automatic health monitoring, stats, and endpoint management.</Description>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/NATS.Client.Simplified/NATS.Client.Simplified.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<!-- NuGet Packaging -->
<PackageTags>pubsub;messaging</PackageTags>
<Description>NATS simplified client for .NET</Description>
<PackageTags>pubsub;messaging;cloud-native;distributed;async;nats</PackageTags>
<Description>Simplified high-level API for NATS .NET. Wraps common pub/sub and request-reply patterns with sensible defaults for quick adoption.</Description>

<RootNamespace>NATS.Net</RootNamespace>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<!-- NuGet Packaging -->
<PackageTags>pubsub;messaging</PackageTags>
<Description>ASP.NET Core and Generic Host support for NATS.Net.</Description>
<PackageTags>pubsub;messaging;cloud-native;aspnetcore;hosting;dependency-injection;nats</PackageTags>
<Description>Microsoft dependency injection extension for NATS .NET. Configures NatsClient with the Generic Host and ASP.NET Core service collection.</Description>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net8.0'">
Expand Down
4 changes: 2 additions & 2 deletions src/NATS.Net/NATS.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<!-- NuGet Packaging -->
<PackageTags>pubsub;messaging</PackageTags>
<Description>NATS client for modern .NET</Description>
<PackageTags>pubsub;messaging;cloud-native;distributed;async;real-time;CNCF;nats</PackageTags>
<Description>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.</Description>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading