From d0c37da6a0fbbcda501b5a3bbead98d95910143f Mon Sep 17 00:00:00 2001 From: Akbar Shaikh Date: Thu, 1 Dec 2022 20:15:21 +0530 Subject: [PATCH] feat: raccoon java client release (#54) --- clients/java/README.md | 6 +++--- .../main/java/io/odpf/raccoon/client/RestClient.java | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/clients/java/README.md b/clients/java/README.md index c875ae05..3eab690f 100644 --- a/clients/java/README.md +++ b/clients/java/README.md @@ -3,7 +3,7 @@ ## Requirements -- [Gradle v5+](https://gradle.org/) +- [Gradle v7+](https://gradle.org/) - [JDK 8+](https://openjdk.java.net/projects/jdk8/) @@ -12,7 +12,7 @@ #### Gradle ```groovy - implementation group: 'io.odpf', name: 'raccoon', version: '0.1.5-rc' + implementation group: 'io.odpf', name: 'raccoon', version: '0.1.5' ``` #### Maven @@ -21,7 +21,7 @@ io.odpf racoon - 0.1.5-rc + 0.1.5 ``` diff --git a/clients/java/src/main/java/io/odpf/raccoon/client/RestClient.java b/clients/java/src/main/java/io/odpf/raccoon/client/RestClient.java index f78bfbe8..fbfe0f29 100644 --- a/clients/java/src/main/java/io/odpf/raccoon/client/RestClient.java +++ b/clients/java/src/main/java/io/odpf/raccoon/client/RestClient.java @@ -125,10 +125,12 @@ private CloseableHttpClient getHttpClient() { @Override public boolean retryRequest(HttpResponse response, int executionCount, HttpContext context) { - LOGGER.warn("Retrying the http request, retry-count:{}, response-code:{}", executionCount, - response.getStatusLine().getStatusCode()); - return executionCount < restConfig.getRetryMax() - && response.getStatusLine().getStatusCode() != HttpStatusCodes.STATUS_CODE_OK; + if (executionCount < restConfig.getRetryMax() && response.getStatusLine().getStatusCode() != HttpStatusCodes.STATUS_CODE_OK) { + LOGGER.warn("Retrying the http request, retry-count:{}, response-code:{}", executionCount, response.getStatusLine().getStatusCode()); + return true; + } + + return false; } @Override