Skip to content

feat: add exponential backoff to api core#102

Merged
dmbrooke merged 13 commits into
mainfrom
KIT-2703
Sep 12, 2023
Merged

feat: add exponential backoff to api core#102
dmbrooke merged 13 commits into
mainfrom
KIT-2703

Conversation

@dmbrooke

@dmbrooke dmbrooke commented Sep 5, 2023

Copy link
Copy Markdown
Contributor

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

github-actions Bot commented Sep 5, 2023

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Manifest Files

pom.xml

Comment thread src/main/java/com/coveo/pushapiclient/BackoffOptions.java Outdated
Comment thread src/main/java/com/coveo/pushapiclient/ApiCore.java Outdated
@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

@louis-bompart louis-bompart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread src/main/java/com/coveo/pushapiclient/PushSource.java

@y-lakhdar y-lakhdar left a comment

Copy link
Copy Markdown
Contributor

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?

Comment thread src/main/java/com/coveo/pushapiclient/Source.java Outdated
@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.

4 participants