Microsoft.Orleans.Clustering.Redis 9.2.0-preview3

Microsoft Orleans Clustering for Redis

Introduction

Microsoft Orleans Clustering for Redis provides cluster membership functionality for Microsoft Orleans using Redis. This allows Orleans silos to coordinate and form a cluster using Redis as the backing store.

Getting Started

To use this package, install it via NuGet:

dotnet add package Microsoft.Orleans.Clustering.Redis

Example - Configuring Redis Membership

using Microsoft.Extensions.Hosting;
using Orleans.Hosting;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Threading.Tasks;

var builder = Host.CreateApplicationBuilder(args)
    .UseOrleans(siloBuilder =>
    {
        siloBuilder
            // Configure Redis as the membership provider
            .UseRedisClustering(options =>
            {
                options.ConnectionString = "localhost:6379";
                options.Database = 0;
            });
    });

var host = builder.Build();
await host.StartAsync();

// Get a reference to a grain and call it
var client = host.Services.GetRequiredService<IClusterClient>();
var grain = client.GetGrain<IHelloGrain>("user123");
var response = await grain.SayHello("Redis");

// Print the result
Console.WriteLine($"Grain response: {response}");

// Keep the host running until the application is shut down
await host.WaitForShutdownAsync();

Example - Client Configuration

using Microsoft.Extensions.Hosting;
using Orleans.Hosting;
using Orleans;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Threading.Tasks;

var clientBuilder = Host.CreateApplicationBuilder(args)
    .UseOrleansClient(builder =>
    {
        builder
            // Configure Redis as the gateway provider
            .UseRedisGatewayListProvider(options =>
            {
                options.ConnectionString = "localhost:6379";
                options.Database = 0;
            });
    });

var host = clientBuilder.Build();
await host.StartAsync();
var client = host.Services.GetRequiredService<IClusterClient>();

// Get a reference to a grain and call it
var grain = client.GetGrain<IHelloGrain>("user123");
var response = await grain.SayHello("Redis Client");

// Print the result
Console.WriteLine($"Grain response: {response}");

// Keep the host running until the application is shut down
await host.WaitForShutdownAsync();

Documentation

For more comprehensive documentation, please refer to:

Feedback & Contributing

No packages depend on Microsoft.Orleans.Clustering.Redis.

Version Downloads Last updated
10.4.2 0 10/30/2026
10.4.1 0 10/28/2026
10.4.0 2 10/27/2026
10.3.1 2 09/26/2026
10.3.0 3 09/26/2026
10.3.0-rc.1 2 09/26/2026
10.2.2 2 09/26/2026
10.2.2-rc.2 1 09/26/2026
10.2.2-rc.1 2 09/26/2026
10.2.1 1 09/26/2026
10.2.1-preview.1 4 09/26/2026
10.2.0 1 09/26/2026
10.1.1-preview.1 2 09/26/2026
10.1.0 1 09/26/2026
10.0.1 3 09/26/2026
10.0.0 1 09/26/2026
10.0.0-rc.2 3 09/26/2026
9.2.1 1 09/26/2026
9.2.0 1 10/27/2026
9.2.0-preview3 1 09/26/2026
9.2.0-preview2 1 09/26/2026
9.2.0-preview1 2 09/26/2026
9.1.2 1 09/26/2026
9.0.1 3 09/26/2026
9.0.0 1 09/26/2026
8.2.0 2 06/16/2026
8.2.0-preview1 2 09/26/2026
8.1.0 3 09/26/2026
8.1.0-preview3 3 09/26/2026
8.1.0-preview2 2 09/26/2026
8.1.0-preview1 2 09/26/2026
8.0.0 1 09/26/2026
8.0.0-rc2 1 09/26/2026
8.0.0-rc1 2 09/26/2026
7.2.7 0 10/15/2024
7.2.6 3 09/26/2026
7.2.5 0 02/22/2024
7.2.4 1 09/26/2026
7.2.3 2 09/26/2026
7.2.2 2 09/26/2026
7.2.1 0 07/11/2023
7.2.0 1 09/26/2026
7.1.2-beta1 2 09/26/2026
7.1.1-beta1 3 09/26/2026
7.1.0-beta1 2 09/26/2026