Aaron.Akka.Discovery.Redis 0.2.0

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

Akka.NET Aspire Plugin

Automated Akka.NET cluster formation for .NET Aspire. Configure your cluster topology in the AppHost, and each service replica will automatically discover peers, form a cluster, and report health status.

Packages

Package Target Description
Aaron.Akka.Aspire.Hosting net10.0 AppHost-side: AddAkka(), WithClustering(), WithReference()
Aaron.Akka.Aspire net10.0 Service-side: WithAspireClusterBootstrap() reads Aspire-injected config
Aaron.Akka.Discovery.Redis netstandard2.0; net9.0; net10.0 Redis-based service discovery plugin

Usage

AppHost

using Aaron.Akka.Aspire.Hosting;

var builder = DistributedApplication.CreateBuilder(args);

var redis = builder.AddRedis("akka-discovery");

var akka = builder.AddAkka("my-cluster")
    .WithClustering(redis);

builder.AddProject<Projects.MyService>("service")
    .WithHttpEndpoint(name: "http")
    .WithReplicas(3)
    .WithReference(akka);

builder.Build().Run();

Service (Redis Discovery)

using Aaron.Akka.Aspire;
using Aaron.Akka.Discovery.Redis;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddAkka("MySystem", (akkaBuilder, sp) =>
{
    akkaBuilder.WithAspireClusterBootstrap(sp,
        configureDiscovery: (b, config) =>
        {
            var redisConn = config.GetConnectionString("akka-discovery");
            if (!string.IsNullOrEmpty(redisConn))
                b.WithRedisDiscovery(redisConn, config["Akka:Cluster:ServiceName"]);
        },
        clusterConfigure: c => c.Roles = ["my-service"]);
});

builder.Services.AddHealthChecks();
var app = builder.Build();

app.MapHealthChecks("/healthz");
app.MapGet("/", () => "Hello from Akka.NET!");
app.Run();

WithAspireClusterBootstrap configures Akka.Remote, Akka.Cluster, Akka.Management, Cluster Bootstrap, and health checks from the environment variables that the hosting package injects. The configureDiscovery callback wires up the discovery plugin using the same IConfiguration that Aspire populates. No manual HOCON needed.

How It Works

The hosting package (WithReference(akka)) injects environment variables into each service replica:

  • Akka__Cluster__Enabled - enables clustering
  • Akka__Cluster__RemotePort / Akka__Cluster__ManagementPort - unique ports per replica
  • Akka__Cluster__PublicHostName / Akka__Cluster__ServiceName - discovery identity
  • Akka__Cluster__RequiredContactPointsNr - derived from replica count
  • Akka__Cluster__Clustering__ProviderType - auto-detected from the resource type (e.g. Redis, AzureTableStorage)
  • Akka__Cluster__Clustering__ConnectionStringName - the Aspire resource name for the discovery backend
  • Connection string for the discovery backend (e.g. ConnectionStrings__akka-discovery)

The service-side bootstrap reads these via IConfiguration, configures the full Akka.NET cluster stack, and uses the discovery plugin to find other replicas. Cluster Bootstrap's SelfAwareJoinDecider handles initial seed node election.

Supported Discovery Providers

Production Deployment

The configureDiscovery callback makes it straightforward to swap discovery providers between environments. Only the AppHost and the callback change -- the rest of the service code stays identical.

Azure Table Storage (local dev with Azurite, production with real Azure)

AppHost:

var storage = builder.AddAzureStorage("azure-storage").RunAsEmulator();
var tables = storage.AddTables("akka-discovery");

var akka = builder.AddAkka("my-cluster")
    .WithClustering(tables);

Service:

akkaBuilder.WithAspireClusterBootstrap(sp,
    configureDiscovery: (b, config) =>
    {
        var azureConn = config.GetConnectionString("akka-discovery");
        if (!string.IsNullOrEmpty(azureConn))
            b.WithAzureDiscovery(azureConn, config["Akka:Cluster:ServiceName"]);
    },
    clusterConfigure: c => c.Roles = ["my-service"]);

Kubernetes (no connection string needed)

Service:

akkaBuilder.WithAspireClusterBootstrap(sp,
    configureDiscovery: (b, config) =>
    {
        b.WithKubernetesDiscovery();
    },
    clusterConfigure: c => c.Roles = ["my-service"]);

See the samples/ directory for complete working examples with Redis and Azure Table Storage.

Learn More

  • Akka.NET Clustering - how Akka.NET clusters work, membership lifecycle, and seed node discovery
  • Akka.Management - HTTP management endpoint and Cluster Bootstrap for automated cluster formation
  • Akka.Hosting - IServiceCollection integration for configuring Akka.NET without raw HOCON
  • .NET Aspire - orchestration, service discovery, and telemetry for distributed .NET apps

Building

dotnet tool restore
dotnet build -c Release
dotnet test -c Release
dotnet pack -c Release -o ./bin/nuget

Integration tests require Docker (they spin up a Redis container via Aspire).

License

Apache-2.0

Pinning Actions to SHAs

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 (1)

Showing the top 1 popular GitHub repositories that depend on Aaron.Akka.Discovery.Redis:

Repository Stars
petabridge/DrawTogether.NET
Multi-player MS Paint application. Built with Akka.NET, Blazor, and .NET Aspire.
Version Downloads Last Updated
0.2.0 94 5/28/2026
0.1.0 2,554 2/6/2026

**Security:**
- Updated OpenTelemetry packages to 1.15.x — patches 4 known vulnerabilities (GHSA-g94r-2vxg-569j, GHSA-4625-4j76-fww9, GHSA-mr8r-92fq-pj8p, GHSA-q834-8qmm-v933)

**Dependencies:**
- .NET Aspire updated to 13.3.5
- Akka.NET updated to 1.5.60
- Akka.Hosting updated to 1.5.59 (with cluster bootstrap folded into core)
- Akka.Cluster.Hosting updated to 1.5.59