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

Expose BackOffPolicy creation logic through a BackOffPolicyBuilder #276

Closed
tomazfernandes opened this issue Mar 10, 2022 · 2 comments
Closed
Milestone

Comments

@tomazfernandes
Copy link
Contributor

This issue is to propose exposing value-based BackOffPolicy creation logic, currently in this part of the AnnotationAwareRetryOperationsInterceptor class, through a BackOffPolicyBuilder class, so other Spring projects and perhaps end users can use it, keeping consistency throughout the projects and avoiding duplicated logic.

Context

When Spring Kafka's Non-blocking retries feature was developed, the Spring Retry project wasn't getting many releases. As we wanted to leverage some of Spring Retry's functionality, such as the @BackOff annotation and the BackOffPolicy interface and implementations, the solution was to duplicate the BackOffPolicy creation logic in Spring Kafka, as can be seen here.

Now that we're in the process of adding auto configuration capabilities to the feature, we need to be able to access this logic in Spring Boot as well. After discussing this matter with @wilkinsona and @artembilan, considering the Spring Retry project is now getting more support, it seems like the right approach would be to make this logic accessible through a BackOffPolicyBuilder and use it both in Spring Kafka and Spring Boot projects.

If that does look like the right approach I can provide a PR, if that's ok.

Thanks, and I'm really glad to see this project under more active support again, it's a very useful and well-thought project.

@artembilan
Copy link
Member

That's what we have discussed, @tomazfernandes .

If you really have something in mind, feel free to raise a PR and I'll review it shortly.

Thanks

tomazfernandes added a commit to tomazfernandes/spring-retry that referenced this issue Mar 11, 2022
BackOffPolicyBuilder implementation to expose BackOffPolicy building logic to other projects
@tomazfernandes
Copy link
Contributor Author

Sure @artembilan. As this is a different project I wanted to provide some context to everyone else who might see this issue. I've opened the PR just now.

Thanks

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

3 participants