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

feat: enhance Feign utility using resiliency4j retries #149

Closed
wants to merge 1 commit into from

Conversation

nicdard
Copy link
Collaborator

@nicdard nicdard commented Feb 14, 2023

Description

Currently, retries are implicitly enabled from Feign, using the Default Retryer and with a maximal number of attempts of 5.

The code changes enable the use of resiliency4j retries:

Other approaches:

  1. simply use the Default Retryer but configure a maximum number of retries of 3 (default is 5).
  2. Extend the Retryer interface and implement our custom logic (parameters are a bit different + in case of a negative interval from the header the default retryer doesn't wait)

I think we might be good with just (1) if we do not need any other resiliency pattern, which involves only adding 1 line when creating the Feign builder:

       .retryer(new Default( ... , ... , 3)) // can configure startInterval and maxInterval, last is the number of attempts

Related Issue

#150

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@nicdard
Copy link
Collaborator Author

nicdard commented Feb 23, 2023

See the simplified approach with Feign Retryer: #151

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

Successfully merging this pull request may close these issues.

1 participant