IdempotencyGuard.Redis 1.3.0

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

IdempotencyGuard.Redis

Redis-backed idempotency store for the IdempotencyGuard library. Uses atomic Lua scripts for claim coordination and native Redis key TTL for automatic expiry.

Installation

dotnet add package IdempotencyGuard.AspNetCore
dotnet add package IdempotencyGuard.Redis

Setup

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddIdempotencyGuard(options =>
{
    options.MissingKeyPolicy = MissingKeyPolicy.Reject;
});

builder.Services.AddIdempotencyGuardRedisStore("localhost:6379");

var app = builder.Build();
app.UseIdempotencyGuard();

How it works

All claim operations use atomic Lua scripts evaluated on the Redis server:

  • ClaimSET NX with TTL to atomically acquire a key
  • Complete — Stores the response and updates the entry state in a single script
  • Release — Removes the key to allow retries after failure

Expired entries are cleaned up automatically by Redis key TTL — no background cleanup service needed.

Connection options

// The Redis package owns the connection lifecycle internally.
// AbortOnConnectFail is forced to false for resilient startup/reconnect behavior.
builder.Services.AddIdempotencyGuardRedisStore("localhost:6379");

// Advanced options
builder.Services.AddIdempotencyGuardRedisStore(options =>
{
    options.ConnectionString = "localhost:6379,connectTimeout=5000,syncTimeout=1000";
    options.KeyPrefix = "myapp:idempotency:";
    options.MinimumReconnectInterval = TimeSpan.FromSeconds(60);
});

Connections are created lazily on first use. If Redis is temporarily unavailable, the package keeps ownership of the multiplexer and attempts reconnects on demand. Reconnect attempts are throttled by MinimumReconnectInterval, and AbortOnConnectFail = false is always applied even if the connection string says otherwise.

Why Redis

  • Atomic operations — Lua scripts guarantee consistency under concurrent access
  • Native TTL — No background cleanup needed; Redis handles expiry
  • Distributed — Works across multiple application instances out of the box
  • Low latency — Sub-millisecond claim/response operations

Documentation

See the full documentation on GitHub for middleware configuration, selective fingerprinting, and production deployment guides.

License

MIT

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 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. 
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.3.0 145 4/26/2026
1.2.4 131 4/3/2026
1.2.3 170 3/18/2026
1.2.2 108 3/10/2026
1.2.1 105 3/10/2026
1.2.0 106 3/10/2026
1.1.0 103 3/10/2026
1.0.0 112 3/7/2026