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

[Feature] Support for Polly v8 policies with backwards compatibility #2880

Open
iancooper opened this issue Oct 22, 2023 · 4 comments
Open

Comments

@iancooper
Copy link
Member

Is your feature request related to a problem? Please describe.
Polly, which we use for blocking retry or circuit breakers (blocking here in the sense that a lock on a queue is not released or an offset committed) now has released v8 API. If we want to support the v8API we will need to consider how to support this, as well as V7 (see https://github.com/App-vNext/Polly)

Instead of policies, we now have resilience pipelines as a target.

Describe the solution you'd like
The new resilience builder pipeline is a welcome addition, as we ourselves have had to add support for a single attribute that has multiple policies over multiple policy attributes.

So we need a version of our attribute that instead of taking a policy name, takes a resilience pipeline name. In order to retain backwards compatibility with folks that still want the v7 API we either need:

  • A UseResiliencePipeline attribute that uses the V8 approach, keeping UsePolicy for v7
  • Additional parameters for the UsePolicy attribute to allow setting a resilience pipeline over an array of policies

There are trade-offs to these, but the latter might be more obvious to folks.

Describe alternatives you've considered
The main alternative is to stick on v7, but v8 is more compatible with our needs, not less.

@martincostello
Copy link

Happy to help out with this migration.

FYI, you can upgrade to v8 in a non-breaking way as it retains the previous APIs (i.e. #2918 should be safe to take) - you just won't get the performance benefits of the new API in Polly.Core.

@iancooper
Copy link
Member Author

@martincostello Help would be appreciated. I think we have two options. Move in v10 and make v8 style Polly a dependency, or support both syntaxes in our middleware for a bit.

@iancooper iancooper removed their assignment Feb 8, 2024
@iancooper iancooper added the v10 Allocal to a v10 release label Feb 8, 2024
@iancooper
Copy link
Member Author

After a discussion with Martin we are likely to:

  • Add an enumeration to the UsePolicy(Async) attribute to allow you to choose the API
    • Policy for V7
    • Strategy for V8
  • Return the ExceptionPolicyHandler for V7 but the StrategyPolicyHandler for V8

@iancooper
Copy link
Member Author

See also: #1197 for Polly issues for V10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants