Verbara.Sdk.Push.Nats 2.2.1

dotnet add package Verbara.Sdk.Push.Nats --version 2.2.1
                    
NuGet\Install-Package Verbara.Sdk.Push.Nats -Version 2.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Verbara.Sdk.Push.Nats" Version="2.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Verbara.Sdk.Push.Nats" Version="2.2.1" />
                    
Directory.Packages.props
<PackageReference Include="Verbara.Sdk.Push.Nats" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Verbara.Sdk.Push.Nats --version 2.2.1
                    
#r "nuget: Verbara.Sdk.Push.Nats, 2.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Verbara.Sdk.Push.Nats@2.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Verbara.Sdk.Push.Nats&version=2.2.1
                    
Install as a Cake Addin
#tool nuget:?package=Verbara.Sdk.Push.Nats&version=2.2.1
                    
Install as a Cake Tool

Verbara.Sdk.Push.Nats

NATS bridge for Verbara.Sdk.Push. The bridge subscribes to the in-process Push bus and republishes every event to a NATS subject derived from the event's TopicPath. This unlocks multi-node deployments: one NATS cluster, N SDK instances, each fans out local events to the cluster for topic-based filtering by remote subscribers.

This is the .NET answer to the Go-based ari-proxy pattern: keep the SDK's local Rx bus as the source of truth, let NATS be the transport when you need horizontal scale.

Usage

using Verbara.Sdk.Push.Hosting;
using Verbara.Sdk.Push.Nats;

builder.Services.AddAsteriskPush()
                .AddPushNats(opts =>
                {
                    opts.Url = "nats://nats.internal:4222";
                    opts.SubjectPrefix = "asterisk.sdk";
                    opts.Username = "sdk-bridge";
                    opts.Password = builder.Configuration["NATS_PASSWORD"];
                    opts.ConnectTimeoutSeconds = 10;
                });

Subject translation

The bridge maps Push topic paths to NATS subjects by replacing separators with ., skipping empty segments, and sanitizing characters that NATS forbids. Example:

Push TopicPath NATS subject (prefix asterisk.sdk)
push.channels.uniqueid-42 asterisk.sdk.push.channels.uniqueid-42
push/channels/uniqueid-42 asterisk.sdk.push.channels.uniqueid-42
queues/42/agent state asterisk.sdk.queues.42.agent_state
calls.*.ended asterisk.sdk.calls._.ended (wildcards are disallowed in subjects — they become _)

Both . and / are accepted as input separators so callers are not locked into one convention.

Extension points

  • Custom payload shape: implement INatsPayloadSerializer and register as singleton before AddPushNats. The default serializer emits the same envelope as Verbara.Sdk.Push.Webhooks, so downstream consumers can treat both transports interchangeably.

Observability

Counters on the Verbara.Sdk.Push.Nats meter:

  • asterisk.push.nats.events.published
  • asterisk.push.nats.events.failed

Enroll via Verbara.Sdk.OpenTelemetry.WithAllSources() once the meter name is added to AsteriskTelemetry.MeterNames.

Roadmap

  • PublishOnly = false — subscribe to remote NATS subjects and republish inbound events onto the local Push bus (planned for a later v1.12.x release, tracked in docs/research/2026-04-19-v1.12.0-product-opportunities.md).
  • JetStream durable subscriptions + ordered consumer support.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.1 96 5/23/2026
2.2.0 101 5/20/2026
2.1.2 95 5/8/2026
2.1.1 97 5/7/2026
2.1.0 87 5/7/2026
2.0.0 102 5/6/2026