Verbara.Sdk.Push.Nats
2.7.0
dotnet add package Verbara.Sdk.Push.Nats --version 2.7.0
NuGet\Install-Package Verbara.Sdk.Push.Nats -Version 2.7.0
<PackageReference Include="Verbara.Sdk.Push.Nats" Version="2.7.0" />
<PackageVersion Include="Verbara.Sdk.Push.Nats" Version="2.7.0" />
<PackageReference Include="Verbara.Sdk.Push.Nats" />
paket add Verbara.Sdk.Push.Nats --version 2.7.0
#r "nuget: Verbara.Sdk.Push.Nats, 2.7.0"
#:package Verbara.Sdk.Push.Nats@2.7.0
#addin nuget:?package=Verbara.Sdk.Push.Nats&version=2.7.0
#tool nuget:?package=Verbara.Sdk.Push.Nats&version=2.7.0
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.AddVerbaraPush()
.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
INatsPayloadSerializerand register as singleton beforeAddPushNats. The default serializer emits the same envelope asVerbara.Sdk.Push.Webhooks, so downstream consumers can treat both transports interchangeably.
Observability
Counters on the Verbara.Sdk.Push.Nats meter:
asterisk.push.nats.events.publishedasterisk.push.nats.events.failedasterisk.push.nats.events.receivedasterisk.push.nats.events.skippedasterisk.push.nats.events.decode_failed
Enroll via Verbara.Sdk.OpenTelemetry.WithAllSources() — the meter name is already registered in VerbaraTelemetry.MeterNames.
Subscribe side
- Enabled by setting
Subscribe = new NatsSubscribeOptions { ... }: the bridge consumes from NATS if and only ifSubscribeis non-null.PublishOnlyis kept only for compatibility with v1.12 configurations. SkipSelfOriginatedthen requiresNodeId, and startup validation refuses the configuration without it (loop prevention).- Remote events arrive on the local bus as
RemotePushEvent. - JetStream and durable replay are out of scope for this MIT package.
| Product | Versions 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. |
-
net10.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.12)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- NATS.Client.Core (>= 3.2.0)
- System.Reactive (>= 7.0.0)
- Verbara.Sdk.Push (>= 2.7.0)
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.7.0 | 96 | 10/3/2026 |
| 2.6.1 | 303 | 9/30/2026 |
| 2.6.0 | 504 | 9/24/2026 |
| 2.5.3 | 442 | 9/13/2026 |
| 2.5.2 | 203 | 9/13/2026 |
| 2.5.1 | 198 | 9/12/2026 |
| 2.5.0 | 120 | 8/25/2026 |
| 2.4.0 | 138 | 7/27/2026 |
| 2.3.2 | 128 | 7/20/2026 |
| 2.3.1 | 124 | 7/14/2026 |
| 2.3.0 | 137 | 7/6/2026 |
| 2.2.1 | 129 | 5/23/2026 |
| 2.2.0 | 127 | 5/20/2026 |
| 2.1.2 | 121 | 5/8/2026 |
| 2.1.1 | 124 | 5/7/2026 |
| 2.1.0 | 107 | 5/7/2026 |
| 2.0.0 | 125 | 5/6/2026 |