Skip to content

Conversation

@dmbrooke
Copy link
Contributor

@dmbrooke dmbrooke commented Sep 5, 2023

Disclaimer, this is my first time working with Java in 5-ish years, so I'm very open to suggestions that use more common design principles. Also note that I couldn't figure out a way to ensure that the timeMultiple/retryAfter properties were sleeping for the correct amount of time on each iteration, so I only test that the maxRetries property is being enforced.

With that out of the way, here's exponential backoff for all outgoing requests from the APICore class. I also made sure that implementers are able to configure the backoff options on all classes that leverage the APICore.

Finally, I added a BackOffOptionsBuilder class to ensure there is always a default exponential fallback config (unless otherwise specified) when making requests.

@dmbrooke dmbrooke requested review from a team, mrrajamanickam-coveo, olamothe and y-lakhdar and removed request for a team September 5, 2023 15:55
@github-actions
Copy link

github-actions bot commented Sep 5, 2023

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Manifest Files

pom.xml

@dmbrooke dmbrooke requested a review from olamothe September 6, 2023 19:24
@btaillon-coveo btaillon-coveo self-requested a review September 11, 2023 14:39
Copy link
Contributor

@louis-bompart louis-bompart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@y-lakhdar y-lakhdar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think having an example of this new option in the samples folder is relevant?

@dmbrooke dmbrooke requested a review from y-lakhdar September 11, 2023 20:01
@dmbrooke dmbrooke merged commit 172c936 into main Sep 12, 2023
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.

5 participants