Skip to content

Is it possible to share CircuitBreaker state across several pipelines? #2264

Closed Answered by dcavinar365
dcavinar365 asked this question in Q&A
Discussion options

You must be logged in to vote

I figured out a way that is working in all my tests. Hopefully I didn't miss something crucial!
First I have to create a ResiliencePipeline that just holds the desired circuit breaker strategy:

var cbPipeline = new ResiliencePipelineBuilder()
    .AddCircuitBreaker(options)
    .Build();

Then I can add that to any pipeline that needs that same state using the AddPipeline() builder extension method:

var pipeline = new ResiliencePipelineBuilder()
    .AddPipeline(cbPipeline)
    .Build();

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@dcavinar365
Comment options

@dcavinar365
Comment options

Answer selected by martincostello
@peter-csala
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants