Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1844 More open customization of Polly use #1974

Merged
merged 9 commits into from
Feb 26, 2024

Conversation

RaynaldM
Copy link
Collaborator

In certain contexts, we need to be able to fully tune the way Polly is used for timeouts and circuit-breakers, but not only that.
With this in mind, I'm proposing in this PR to open up the use of AddPolly by adding :

public static IOcelotBuilder AddPolly<T>(this IOcelotBuilder builder, Dictionary<Type, Func<Exception, Error>> errorMapping)
     where T : class, IPollyQoSProvider<HttpResponseMessage> =>
     AddPolly<T>(builder, GetDelegatingHandler, errorMapping);

 public static IOcelotBuilder AddPolly<T>(this IOcelotBuilder builder, QosDelegatingHandlerDelegate delegatingHandler)
     where T : class, IPollyQoSProvider<HttpResponseMessage> =>
     AddPolly<T>(builder, delegatingHandler, ErrorMapping);

 public static IOcelotBuilder AddPolly<T>(this IOcelotBuilder builder)
     where T : class, IPollyQoSProvider<HttpResponseMessage> =>
     AddPolly<T>(builder, GetDelegatingHandler, ErrorMapping);

Thanks to this, we will be able to use our own implementations of IPollyQoSProvider<HttpResponseMessage>, QosDelegatingHandlerDelegate and Dictionary<Type, Func<Exception, Error>>

@RaynaldM RaynaldM added feature A new feature small effort Likely less than a day of development effort. Jan'24 January 2024 release labels Feb 26, 2024
@RaynaldM RaynaldM linked an issue Feb 26, 2024 that may be closed by this pull request
@raman-m raman-m added this to the January'24 milestone Feb 26, 2024
@raman-m
Copy link
Member

raman-m commented Feb 26, 2024

@RaynaldM Please merge by Squash and merge option only ❗ ❗ ❗
Screenshot from 2024-02-26 10-59-39

@raman-m raman-m changed the title 1844 more open customization of polly use #1844 More open customization of Polly use Feb 26, 2024
@RaynaldM RaynaldM merged commit 0404c24 into develop Feb 26, 2024
2 checks passed
@raman-m
Copy link
Member

raman-m commented Feb 26, 2024

Congrats! 🥳

And we don't need this branch anymore...

@raman-m raman-m deleted the 1844-more-open-customization-of-polly-use branch February 26, 2024 08:38
This was referenced Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature Jan'24 January 2024 release small effort Likely less than a day of development effort.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More open customization of Polly use
2 participants