Implement HTTP retry logic and set connection timeout in RESTClient#342
Implement HTTP retry logic and set connection timeout in RESTClient#342
Conversation
- Implemented retry logic in `RESTClient` for `SocketTimeoutException`: up to 3 attempts with a 5-second pause between attempts. - Set the default connection timeout to 30 seconds. - Refactored `RESTClient.query` into `query` (retry loop) and `queryOnce` (single request logic). - Added `openConnection(URL)` and `sleep(long)` methods to `RESTClient` to facilitate testing. - Added `net.jsign.jca.RESTClientTest` to verify the retry logic and timeout. Co-authored-by: ebourg <54304+ebourg@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Implemented retry logic for SocketTimeoutException in RESTClient. - Made retry count, retry pause, connect timeout, and read timeout configurable via fluent setter methods. - Defaulted to 3 attempts, 5s pause, and 30s timeouts. - Added RESTClientTest using WireMock to verify retry behavior on timeout and exhaustion. - Added wiremock-standalone dependency for testing. Co-authored-by: ebourg <54304+ebourg@users.noreply.github.com>
- Implemented retry logic for SocketTimeoutException in RESTClient. - Made retry count, retry pause, connect timeout, and read timeout configurable via plain setter methods. - Defaulted to 3 attempts, 5s pause, and 30s timeouts. - Added RESTClientTest using WireMock to verify retry behavior on timeout and exhaustion. - Added wiremock-standalone dependency for testing. Co-authored-by: ebourg <54304+ebourg@users.noreply.github.com>
- Implemented retry logic for SocketTimeoutException in RESTClient. - Made retry count, retry pause, connect timeout, and read timeout configurable via plain setter methods. - Defaulted to 3 attempts, 5s pause, and 30s timeouts. - Added RESTClientTest using WireMock to verify retry behavior on timeout and recovery. - Added wiremock-standalone 2.27.2 dependency for Java 8 compatibility. Co-authored-by: ebourg <54304+ebourg@users.noreply.github.com>
This change implements the requested HTTP retry logic and connection timeout in the
RESTClientclass. When aSocketTimeoutExceptionoccurs, the client will now retry the request up to 3 times, with a 5-second pause between each attempt. The connection timeout is also set to a fixed 30 seconds for all requests.A new test class
RESTClientTesthas been added to thejsign-cryptomodule to verify these changes. The tests use a subclass ofRESTClientto simulate timeout exceptions and verify the number of retry attempts and the behavior on success or non-timeout errors.PR created automatically by Jules for task 2190678957648858992 started by @ebourg