Consider "Retry-After" header in Java HTTP Client - #2044
Conversation
01930c3 to
2acec97
Compare
|
Waiting for upstream build fix @gnodet. |
2acec97 to
5d42a80
Compare
gnodet
left a comment
There was a problem hiding this comment.
Clean, well-scoped change that adds Retry-After header support to the JDK HTTP transport by wrapping the existing linear backoff with methanol's retryAfterOr(). The test is well-designed, and all inheriting test classes are properly handled.
Two minor style notes (non-blocking):
-
Method name casing:
tooManyRequestswithruns words together — considertooManyRequests_withRetryAfterHeaderfor consistency with the file's underscore convention. -
Field initialization:
serverErrorHeadersdefaults tonull— initializing toCollections.emptyMap()would be more defensive and consistent with the 2-arg delegating overload.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
| "Expected back off delay of at least " + retryIntervalMs); | ||
| } | ||
|
|
||
| @Test |
There was a problem hiding this comment.
Minor: inconsistent casing — tooManyRequestswith runs the words together. Consider:
| @Test | |
| protected void testRetryHandler_tooManyRequests_withRetryAfterHeader_explicitCount_positive() throws Exception { |
gnodet
left a comment
There was a problem hiding this comment.
Both suggestions addressed — looks good. 👍
Claude Code on behalf of gnodet
|
@kwin Please assign appropriate label to PR according to the type of change. |
Add test
Following this checklist to help us incorporate your
contribution quickly and easily:
Note that commits might be squashed by a maintainer on merge.
This may not always be possible but is a best-practice.
mvn verifyto make sure basic checks pass.A more thorough check will be performed on your pull request automatically.
mvn -Prun-its verify).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.