Stratara.Resilience
3.2.1
Prefix Reserved
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
<PackageReference Include="Stratara.Resilience" Version="3.2.1" />
<PackageVersion Include="Stratara.Resilience" Version="3.2.1" />
<PackageReference Include="Stratara.Resilience" />
paket add Stratara.Resilience --version 3.2.1
#r "nuget: Stratara.Resilience, 3.2.1"
#:package Stratara.Resilience@3.2.1
#addin nuget:?package=Stratara.Resilience&version=3.2.1
#tool nuget:?package=Stratara.Resilience&version=3.2.1
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— forIPipelineBehavior,IResilientRequest, andConcurrencyConflictException.Microsoft.Extensions.DependencyInjection.AbstractionsMicrosoft.Extensions.Resilience(Polly).
| 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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Resilience (>= 10.6.0)
- Stratara.Abstractions (>= 3.2.1)
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 |
### 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.