We are developing Azure function in .Net6 which is interacting with multiple 3rd party application over HTTP protocol.
We have implemented Polly to handle transient errors.
The only issue with Polly is that you have to wrap the code with the policy to make it resilient.
var policy = Policy
.Handle<SomeExceptionType>()
.Retry();
policy.Execute(() => DoSomething());
That's why we are also exploring other options e.g implementing resiliency at protocol level like "HTTP".
So the idea is, instead of wrapping policy around code if somehow we can implement resiliency at protocol level so that all request over HTTP protocol must use the same resiliency policy.
This way we don't have to wrap policy around code every time to make it resilient. Any help would be highly appreciated.
Not sure if interceptor would help here!!!