Microsoft.Orleans.Reminders.AdoNet 10.1.0

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Microsoft.Orleans.Reminders.AdoNet --version 10.1.0
                    
NuGet\Install-Package Microsoft.Orleans.Reminders.AdoNet -Version 10.1.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="Microsoft.Orleans.Reminders.AdoNet" Version="10.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Orleans.Reminders.AdoNet" Version="10.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Orleans.Reminders.AdoNet" />
                    
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 Microsoft.Orleans.Reminders.AdoNet --version 10.1.0
                    
#r "nuget: Microsoft.Orleans.Reminders.AdoNet, 10.1.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 Microsoft.Orleans.Reminders.AdoNet@10.1.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=Microsoft.Orleans.Reminders.AdoNet&version=10.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.Orleans.Reminders.AdoNet&version=10.1.0
                    
Install as a Cake Tool

Microsoft Orleans Reminders for ADO.NET

Introduction

Microsoft Orleans Reminders for ADO.NET provides persistence for Orleans reminders using ADO.NET-compatible databases (SQL Server, MySQL, PostgreSQL, etc.). This allows your Orleans applications to schedule persistent reminders that will be triggered even after silo restarts or grain deactivation.

Getting Started

To use this package, install it via NuGet:

dotnet add package Microsoft.Orleans.Reminders.AdoNet

You will also need to install the appropriate ADO.NET provider for your database:

# For SQL Server
dotnet add package Microsoft.Data.SqlClient

# For MySQL
dotnet add package MySql.Data

# For PostgreSQL
dotnet add package Npgsql

Example - Configuring ADO.NET Reminders

using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Orleans.Configuration;
using Orleans.Hosting;
using Example;

// Create a host builder
var builder = Host.CreateApplicationBuilder(args);
builder.UseOrleans(siloBuilder =>
{
    siloBuilder
        .UseLocalhostClustering()
        // Configure ADO.NET as reminder storage
        .UseAdoNetReminderService(options =>
        {
            options.Invariant = "Microsoft.Data.SqlClient";  // For SQL Server
            options.ConnectionString = "Server=localhost;Database=OrleansReminders;User ID=orleans;******;";
        });
});

// Build and start the host
var host = builder.Build();
await host.StartAsync();

// Get a grain reference and use it
var grain = host.Services.GetRequiredService<IGrainFactory>().GetGrain<IReminderGrain>("my-reminder-grain");
await grain.StartReminder("DailyReport");
Console.WriteLine("Reminder started successfully!");

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

Example - Using Reminders in a Grain

using System;
using System.Threading.Tasks;
using Orleans;
using Orleans.Runtime;

namespace Example;

public interface IReminderGrain : IGrainWithStringKey
{
    Task StartReminder(string reminderName);
    Task StopReminder();
}

public class ReminderGrain : Grain, IReminderGrain, IRemindable
{
    private string _reminderName = "MyReminder";

    public async Task StartReminder(string reminderName)
    {
        _reminderName = reminderName;

        // Register a persistent reminder
        await RegisterOrUpdateReminder(
            reminderName,
            TimeSpan.FromMinutes(2),  // Time to delay before the first tick (must be > 1 minute)
            TimeSpan.FromMinutes(5)); // Period of the reminder (must be > 1 minute)
    }

    public async Task StopReminder()
    {
        // Find and unregister the reminder
        var reminder = await GetReminder(_reminderName);
        if (reminder != null)
        {
            await UnregisterReminder(reminder);
        }
    }

    public Task ReceiveReminder(string reminderName, TickStatus status)
    {
        // This method is called when the reminder ticks
        Console.WriteLine($"Reminder {reminderName} triggered at {DateTime.UtcNow}. Status: {status}");
        return Task.CompletedTask;
    }
}

Documentation

For more comprehensive documentation, please refer to:

Feedback & Contributing

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (17)

Showing the top 5 NuGet packages that depend on Microsoft.Orleans.Reminders.AdoNet:

Package Downloads
Microsoft.Orleans.OrleansSqlUtils

Library of utility types for relational storage of Microsoft Orleans

KingMetal.Domains.Abstractions

Package Description

Mtl.Infrastructures.Workers

主要是封装了下Netty服务器和客户端的方法,提供了简单的方法调用就能启动Netty服务器和客户端,封装了Orleans的服务器和客户端的启动和连接方法,使操作简单,减少重复的代码

Orleans.AdoNet.Extensions

Orleans extensions for configuring cluster,reminder,grain persistence and so on

iTool.ClusterComponent

为NetCore提供 In Process 可靠的/高速的 缓存、队列等常用分布式组件。 无第三方依赖的开发友好、运维友好型框架

GitHub repositories (4)

Showing the top 4 popular GitHub repositories that depend on Microsoft.Orleans.Reminders.AdoNet:

Repository Stars
axzxs2001/Asp.NetCoreExperiment
原来所有项目都移动到**OleVersion**目录下进行保留。新的案例装以.net 5.0为主,一部分对以前案例进行升级,一部分将以前的工作经验总结出来,以供大家参考!
J-Tech-Japan/Sekiban
Sekiban - an Opinionated Event Sourcing and CQRS Framework using C#. It can store data into Azure Cosmos DB, AWS Dynamo DB or Postgres
OrleansContrib/Orleans.Sagas
A distributed saga implementation for Orleans
shinyorg/templates
dotnet CLI & Visual Studio Templates
Version Downloads Last Updated
10.1.1-preview.1 63 5/13/2026
10.1.0 11,595 4/14/2026
10.0.1 31,471 2/7/2026
10.0.0 7,225 1/20/2026
10.0.0-rc.2 546 12/31/2025
9.2.1 77,356 7/16/2025
9.2.0 5,321 7/14/2025
9.2.0-preview3 472 6/10/2025
9.2.0-preview2 296 6/4/2025
9.2.0-preview1 384 4/4/2025
9.1.2 44,712 2/13/2025
9.0.1 13,936 11/23/2024
3.8.1 1,117 4/24/2026
3.8.0 8,285 5/6/2025
3.8.0-preview5 323 5/12/2025
3.8.0-preview3 321 4/8/2025
3.8.0-preview2 240 4/4/2025
3.8.0-preview1 296 3/31/2025
Loading failed