Rymote.Synapse.AspNetCore 1.0.0

dotnet add package Rymote.Synapse.AspNetCore --version 1.0.0
                    
NuGet\Install-Package Rymote.Synapse.AspNetCore -Version 1.0.0
                    
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="Rymote.Synapse.AspNetCore" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rymote.Synapse.AspNetCore" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Rymote.Synapse.AspNetCore" />
                    
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 Rymote.Synapse.AspNetCore --version 1.0.0
                    
#r "nuget: Rymote.Synapse.AspNetCore, 1.0.0"
                    
#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 Rymote.Synapse.AspNetCore@1.0.0
                    
#: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=Rymote.Synapse.AspNetCore&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Rymote.Synapse.AspNetCore&version=1.0.0
                    
Install as a Cake Tool

Rymote.Synapse.AspNetCore

ASP.NET Core integration for Rymote.Synapse.

Provides:

  • IHostedService that starts/stops the Synapse cluster as part of the ASP.NET Core application lifecycle.
  • A /synapse/health endpoint that reports peer connectivity status.
  • A generic HTTP publish endpoint for triggering event publishes via HTTP POST.

Installation

dotnet add package Rymote.Synapse.AspNetCore

Quickstart

WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

// Register Synapse
builder.Services
    .AddSynapse(options => options.NodeIdentity = NodeIdentity.NewIdentity())
    .UseMessagePackSerialization()
    .UseMemoryPersistence()
    .UseTcpTransport(...)
    .UseStaticMembership(...)
    .UseCluster(...);

// Register the hosted service — cluster starts/stops with the host
builder.Services.AddSynapseHosted();

WebApplication app = builder.Build();

// Health endpoint: GET /synapse/health
app.MapSynapseHealth();

// Optional: HTTP-triggered publish for MyEvent payloads
app.MapSynapsePublish<MyEvent>("/events/my-event");

app.Run();

Hosted Service

AddSynapseHosted() registers a SynapseClusterHostedService that:

  • On host start: calls ClusterManager.StartAsync, establishing peer connections.
  • On host stop: calls ClusterManager.DisposeAsync, tearing down all connections cleanly.

If UseCluster() was not called, the service is a no-op (it logs a debug message and returns).

Health Endpoint

app.MapSynapseHealth(pattern = "/synapse/health") exposes a GET endpoint returning JSON:

{
  "self_identity": "00000000000000000000000000000001",
  "peer_count": 2,
  "peers": [
    { "identity": "00000000000000000000000000000002", "state": "connected" },
    { "identity": "00000000000000000000000000000003", "state": "reconnecting" }
  ],
  "status": "degraded"
}

Status values and HTTP codes:

Status Meaning HTTP code
healthy All peers connected/connecting, or no peers 200
degraded Any peer is reconnecting or disconnected 200
unhealthy Any peer is declared dead 503

Publish Endpoint

app.MapSynapsePublish<TPayload>(pattern) maps a POST handler that:

  • Deserializes the JSON request body to TPayload.
  • Publishes via ISynapseBus.PublishAsync.
  • Returns 202 Accepted on success, 400 Bad Request if deserialization fails.

This is useful for webhook integrations and integration testing.

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
1.0.0 93 5/18/2026