Could somebody please explain to me or give me examples on how "Retry" should be set up with the resilience pipeline builder? #3960
Replies: 5 comments 5 replies
-
|
Going to move this to a discussion |
Beta Was this translation helpful? Give feedback.
-
|
Going to check with @lillo42 as he worked on Fluent Brighter
At a guess, the type of your resilience pipeline should be |
Beta Was this translation helpful? Give feedback.
-
|
@MaxwellAllen216 I'll ping @lillo42 to try and highlight this for you |
Beta Was this translation helpful? Give feedback.
-
|
Hey @MaxwellAllen216 can you share your handler? Maybe you should use this options.AddResiliencePipeline("DatabaseRetry", (builder, context) =>
{
builder.AddRetry(new RetryStrategyOptions // just to note, with the fluent package, AddRetry is not generic
{
ShouldHandle = new PredicateBuilder()
.Handle<DbUpdateException>()
.Handle<SqlException>(),
MaxRetryAttempts = 3,
Delay = TimeSpan.FromSeconds(1),
BackoffType = DelayBackoffType.Exponential
});
}); |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @MaxwellAllen216 that is really valuable feedback
100%, I think it is one of our biggest weaknesses and we need to find a better, simpler path
Yeah, it is on our radar. We do this ourselves for the samples, and have been discussing a tool extracted from that to do this. I'll make sure it is our backlog. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've been at this issue for at least 4 hours. I just want my asynchronous command handler to use the UseResiliencePipelineAsync attribute.
The issue I am having is that I get an error indicating the pipeline needs to be generic, most likely the command model needs to be passed in the generic, but I have been getting several issues.
The Goal:
Issues:
If I try and use the synchronous UseResiliencePipeline attribute, I get an error indicating I cannot use it inside an asynchronous handler
If I try adding a non-generic pipeline, I get a "KeyNotFound" error indicating it tried to look for the pipeline with a generic.
If I add the generics, I still get the same "KeyNotFound" error. This is most likely because I had switched to using the fluent.brighter package, as it did happen to work the regular way. But I would like to use the fluent package if it's possible to reach my goal with it.
KeyNotFoundException:
What I currently have:
What am I doing wrong? What is the correct/latest way to add the pipeline?
Thanks for any help!
Beta Was this translation helpful? Give feedback.
All reactions