Stratara.Resilience 3.2.1

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

Stratara.Resilience

License: MIT.

Polly-based named resilience pipelines pre-wired for Stratara's messaging + outbox dispatch paths.

Quick start

services.AddResiliencePipelines();

// Resolve a specific named pipeline at the call site:
var pipeline = sp.GetRequiredService<ResiliencePipelineProvider<string>>()
    .GetPipeline(ResilienceNames.CommandDispatcher);

await pipeline.ExecuteAsync(async ct => {
    await DoFlakyWorkAsync(ct);
}, cancellationToken);

Named pipelines

Name Constant Strategy
Message bus ResilienceNames.MessageBus Exponential retry up to int.MaxValue, 10s → 60s, jitter, then a circuit breaker — opens after 10 consecutive failures and stays open 60s before a trial call
Command dispatcher ResilienceNames.CommandDispatcher 3 retries, exponential, 200ms, jitter
Event bundle dispatcher ResilienceNames.EventBundleDispatcher 3 retries, exponential, 200ms, jitter
Concurrency conflict ResilienceNames.ConcurrencyConflict Retry only on ConcurrencyConflictException, 5 attempts, short exponential, jitter

The ResilienceFactory that builds these is internal — interact via DI and ResilienceNames only.

Mediator resilience behavior

Hook a named pipeline into the in-process mediator pipeline per request — no manual ExecuteAsync plumbing:

services.AddResiliencePipelines();
services.AddStrataraResilienceBehavior();   // after AddStrataraValidation() / AddStrataraTenantIsolation()

public sealed record ReserveStock(Guid Id, int Qty) : ICommand<bool>, IResilientRequest
{
    public string ResiliencePipelineName => ResilienceNames.ConcurrencyConflict;
}

Any request implementing Stratara.Abstractions.Resilience.IResilientRequest is dispatched inside the named pipeline it selects; unmarked requests pass straight through. Only mark handlers that are safe to re-run — naturally idempotent work, or operations guarded by optimistic concurrency (point at the ConcurrencyConflict pipeline). Register the behavior after the validation / tenant-isolation behaviors so a retry re-runs the handler, not the guards.

Dependencies

  • Stratara.Abstractions — for IPipelineBehavior, IResilientRequest, and ConcurrencyConflictException.
  • Microsoft.Extensions.DependencyInjection.Abstractions
  • Microsoft.Extensions.Resilience (Polly).
Product 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.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Stratara.Resilience:

Package Downloads
Stratara.Shared

Umbrella package for the Stratara framework — source-generated logger extensions for command flows, domain-event helpers, merge primitives, and the Tier-A/B abstractions surface re-exported as one transitive bundle.

Stratara.Orleans

The Orleans execution model for the Stratara event-sourced stack — one activation per aggregate across the cluster, commands recorded before the call returns and resumed after a crash, projections and sagas that read the store in commit order from a checkpoint, singleton work, owner-checked durable timers and heavy work bounded across the cluster.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.4.10 94 10/26/2026
4.4.9 88 10/26/2026
4.4.8 279 10/24/2026
4.4.7 150 10/23/2026
4.4.6 330 10/22/2026
4.4.5 758 10/14/2026
4.4.4 519 10/10/2026
4.4.3 249 10/10/2026
4.4.2 607 10/2/2026
4.4.1 563 9/29/2026
4.4.0 299 9/27/2026
4.3.1 356 9/25/2026
4.3.0 531 9/23/2026
4.2.0 307 9/18/2026
4.1.1 313 9/16/2026
4.1.0 247 9/16/2026
4.0.4 1,103 9/14/2026
4.0.3 340 9/3/2026
4.0.2 767 9/3/2026
3.2.1 868 8/2/2026
Loading failed

### Fixed

- **Snapshot loads are now scoped to the aggregate type.** The snapshot read previously filtered
 only by stream id, so when two aggregate types shared a stream id, rehydrating one type could
 pick up the other type's (higher-versioned) snapshot and deserialize it into the requested type —
 silently returning an aggregate with default/empty fields. Snapshot reads now match the aggregate
 type (version-independently, so an assembly rev-bump does not invalidate existing snapshots), and
 snapshot writes are grouped per `(stream, aggregate type)` so a stream carrying more than one type
 snapshots each type independently. A snapshot of type X may now only ever rehydrate type X.

### Changed

- **`ISnapshotRepository` gained type-scoped read overloads.** `GetAsync(streamId,
 aggregateTypeName, toVersion, ct)` and `GetLatestVersionOrDefaultAsync(streamId,
 aggregateTypeName, ct)` are the correct lookups; the previous type-less overloads are now
 `[Obsolete]` because they can return a foreign aggregate type's snapshot on a shared stream.
 Custom `ISnapshotRepository` implementers should add the new overloads.