Intropy.IdempotencyService.Client
0.1.0
dotnet add package Intropy.IdempotencyService.Client --version 0.1.0
NuGet\Install-Package Intropy.IdempotencyService.Client -Version 0.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="Intropy.IdempotencyService.Client" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Intropy.IdempotencyService.Client" Version="0.1.0" />
<PackageReference Include="Intropy.IdempotencyService.Client" />
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 Intropy.IdempotencyService.Client --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Intropy.IdempotencyService.Client, 0.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 Intropy.IdempotencyService.Client@0.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=Intropy.IdempotencyService.Client&version=0.1.0
#tool nuget:?package=Intropy.IdempotencyService.Client&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Intropy Idempotency Service Client
A .NET client library for the Intropy Idempotency Service that uses Dapr service invocation for distributed message deduplication and idempotency checking.
Installation
dotnet add package Intropy.IdempotencyService.Client
Usage
Configuration with Dependency Injection
using Intropy.IdempotencyService.Client;
// In your Startup.cs or Program.cs
services.AddIdempotencyServiceClient(options =>
{
options.AppId = "idempotency-service"; // Dapr app ID of the target service
options.DaprHttpEndpoint = "http://localhost:3500"; // Optional: Local Dapr sidecar HTTP endpoint (default: http://localhost:3500)
});
Or configure using appsettings.json:
{
"IdempotencyService": {
"AppId": "idempotency-service",
"DaprHttpEndpoint": "http://localhost:3500"
}
}
services.AddIdempotencyServiceClient(Configuration);
Using the Client
using Intropy.IdempotencyService.Client;
using Intropy.IdempotencyService.Client.Models;
public class MyService
{
private readonly IIdempotencyServiceClient _idempotencyClient;
public MyService(IIdempotencyServiceClient idempotencyClient)
{
_idempotencyClient = idempotencyClient;
}
public async Task ProcessMessage(string component, string messageId, string messageContent)
{
// Check if message was already processed
var existingInfo = await _idempotencyClient.GetInfoAsync(component, messageId, CancellationToken.None);
if (existingInfo != null)
{
// Message was already processed
return;
}
// Create message info with hash of content
var messageInfo = new MessageInfo(
Component: component,
Id: messageId,
Hash: ComputeHash(messageContent),
Timestamp: DateTime.UtcNow
);
// Check if we should process this message
var status = await _idempotencyClient.GetStatusAsync(messageInfo);
if (status.Action == Action.Proceed)
{
// Process the message
await ProcessMessageInternal(messageContent);
// Commit the message to mark it as processed
await _idempotencyClient.CommitAsync(messageInfo);
}
else
{
// Message should be ignored
Console.WriteLine($"Ignoring message: {status.Reason}");
}
}
private string ComputeHash(string content)
{
using var sha256 = System.Security.Cryptography.SHA256.Create();
var bytes = System.Text.Encoding.UTF8.GetBytes(content);
var hash = sha256.ComputeHash(bytes);
return Convert.ToBase64String(hash);
}
}
API Reference
IIdempotencyServiceClient
GetInfoAsync(string component, string id, CancellationToken cancellationToken)- Retrieve message info if it existsGetStatusAsync(MessageInfo messageInfo)- Check if a message should be processed or ignoredCommitAsync(MessageInfo messageInfo)- Commit a message record to mark it as processed
Models
MessageInfo- Contains component name, message ID, content hash, and timestampStatusResponse- Contains action (Proceed/Ignore) and reasonAction- Enum: Proceed or IgnoreReason- Enum: NewerData, SameData, StaleData, or NoPreviousData
Requirements
- .NET 10.0 or later
- Dapr runtime with sidecar configured
- Access to the Idempotency Service via Dapr service invocation
Links
License
| Product | Versions 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.
-
net10.0
- Dapr.Client (>= 1.17.9)
- Intropy.Contracts (>= 0.1.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Http (>= 10.0.8)
- Microsoft.Extensions.Options (>= 10.0.8)
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 |
|---|---|---|
| 0.1.0 | 101 | 6/2/2026 |