PollyBulkhead 1.0.0

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

Polly.Contrib.Bulkhead

<img src="icon.png" width="100" align="right" />

NuGet CI

Bulkhead isolation strategy for Polly v8 resilience pipelines. Limits concurrent executions and queued actions, rejecting excess calls with BulkheadRejectedException.

Polly v8 replaced the v7 BulkheadPolicy with the more general RateLimiter strategy. This package restores the familiar bulkhead semantics — explicit max concurrency and max queue depth — as a first-class Polly v8 resilience strategy.

Install

dotnet add package Polly.Contrib.Bulkhead

Usage

Simple concurrency limit

using Polly.Contrib.Bulkhead;

var pipeline = new ResiliencePipelineBuilder()
    .AddBulkhead(maxConcurrency: 10)
    .Build();

await pipeline.ExecuteAsync(async ct => await CallDownstreamAsync(ct), cancellationToken);

With a queue

var pipeline = new ResiliencePipelineBuilder()
    .AddBulkhead(maxConcurrency: 10, maxQueuedActions: 20)
    .Build();

Calls beyond the 10 concurrent slots queue up. If the queue also fills (>20 waiting), further calls throw BulkheadRejectedException.

Full options

var pipeline = new ResiliencePipelineBuilder()
    .AddBulkhead(new BulkheadStrategyOptions
    {
        MaxConcurrency = 10,
        MaxQueuedActions = 20,
        OnBulkheadRejected = args =>
        {
            logger.LogWarning("Bulkhead rejected call for {Operation}", args.Context.OperationKey);
            return ValueTask.CompletedTask;
        },
    })
    .Build();

Generic pipeline

var pipeline = new ResiliencePipelineBuilder<HttpResponseMessage>()
    .AddBulkhead<HttpResponseMessage>(maxConcurrency: 5)
    .AddRetry(...)
    .Build();

Behaviour

Scenario Outcome
Slots available Executes immediately
Slots full, queue not full Waits in queue
Slots full, queue full Throws BulkheadRejectedException
No queuing (MaxQueuedActions = 0) Rejects immediately when at capacity

Composition

Place bulkhead before retry so rejected calls don't get retried:

var pipeline = new ResiliencePipelineBuilder()
    .AddBulkhead(maxConcurrency: 10)  // 1. limit concurrency first
    .AddRetry(...)                     // 2. retry transient failures
    .AddCircuitBreaker(...)            // 3. protect downstream
    .Build();

Support

If Polly.Contrib.Bulkhead helps protect your services, consider supporting the project:

Sponsor

💼 Need .NET resilience help? Visit solidqualitysolutions.com for consulting and architecture services.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 was computed.  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.0.0 50 6/23/2026

1.0.1: Initial NuGet release. Bulkhead isolation strategy for Polly v8 resilience pipelines. Supports net6.0, net8.0, and net9.0.