From 9f7246a19e4913a03201ce929a527203f7be2746 Mon Sep 17 00:00:00 2001 From: Iurii Ignatko Date: Tue, 28 Dec 2021 23:02:49 +0200 Subject: [PATCH 1/3] Enable use of system properties for Apache Http Client --- .../java/com/kount/ris/transport/HttpApiTransport.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/kount-ris-sdk/src/main/java/com/kount/ris/transport/HttpApiTransport.java b/kount-ris-sdk/src/main/java/com/kount/ris/transport/HttpApiTransport.java index b49ed79..4b09ba0 100644 --- a/kount-ris-sdk/src/main/java/com/kount/ris/transport/HttpApiTransport.java +++ b/kount-ris-sdk/src/main/java/com/kount/ris/transport/HttpApiTransport.java @@ -62,7 +62,7 @@ public class HttpApiTransport extends Transport { */ protected String apiKey; - private CloseableHttpClient httpClient; + private volatile CloseableHttpClient httpClient; /** * Connection Time To Live @@ -130,6 +130,7 @@ private CloseableHttpClient getHttpClient() { synchronized (this) { if (httpClient == null) { httpClient = HttpClients.custom() + .useSystemProperties() .setConnectionTimeToLive(connectionTimeToLive, TimeUnit.MINUTES) .setDefaultSocketConfig(SocketConfig.custom() .setSoTimeout(this.readTimeout) @@ -160,7 +161,7 @@ public Reader send(Map params) throws RisTransportException { params.put("PENC", ""); } - Reader reader = null; + final Reader reader; try { long startTime = System.currentTimeMillis(); @@ -184,8 +185,6 @@ public Reader send(Map params) throws RisTransportException { logger.debug(builder.toString()); } - } catch (Exception e) { - throw e; } } catch (Exception ioe) { logger.error("Error fetching RIS response", ioe); @@ -207,8 +206,6 @@ public ByteArrayInputStream readAllIntput(HttpEntity entity) throws IOException buffer.flush(); return new ByteArrayInputStream(buffer.toByteArray()); - } catch (Exception e) { - throw e; } finally { EntityUtils.consume(entity); } From cdcb1a2ce6a0c7126b7b4d9d91ecf226433f8aa5 Mon Sep 17 00:00:00 2001 From: Daniel Harp Date: Thu, 6 Jan 2022 09:30:06 -0600 Subject: [PATCH 2/3] Revert a few minor changes included from remote PR --- .../main/java/com/kount/ris/transport/HttpApiTransport.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kount-ris-sdk/src/main/java/com/kount/ris/transport/HttpApiTransport.java b/kount-ris-sdk/src/main/java/com/kount/ris/transport/HttpApiTransport.java index 4b09ba0..1e3a4bd 100644 --- a/kount-ris-sdk/src/main/java/com/kount/ris/transport/HttpApiTransport.java +++ b/kount-ris-sdk/src/main/java/com/kount/ris/transport/HttpApiTransport.java @@ -62,7 +62,7 @@ public class HttpApiTransport extends Transport { */ protected String apiKey; - private volatile CloseableHttpClient httpClient; + private CloseableHttpClient httpClient; /** * Connection Time To Live @@ -161,7 +161,7 @@ public Reader send(Map params) throws RisTransportException { params.put("PENC", ""); } - final Reader reader; + Reader reader = null; try { long startTime = System.currentTimeMillis(); From c3d5dc666ee4e1bae0adba2f4ca833f6ecd140ca Mon Sep 17 00:00:00 2001 From: Daniel Harp Date: Thu, 6 Jan 2022 09:33:27 -0600 Subject: [PATCH 3/3] Bump minor release version --- kount-ris-sdk/pom.xml | 2 +- pom.xml | 2 +- sdk-integration-tests/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kount-ris-sdk/pom.xml b/kount-ris-sdk/pom.xml index 384c600..c667e96 100644 --- a/kount-ris-sdk/pom.xml +++ b/kount-ris-sdk/pom.xml @@ -6,7 +6,7 @@ com.kount kount-java-parent - 7.3.12 + 7.4.0 kount-ris-sdk diff --git a/pom.xml b/pom.xml index dfb781a..ba1f898 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.kount kount-java-parent - 7.3.12 + 7.4.0 pom Kount Java SDK diff --git a/sdk-integration-tests/pom.xml b/sdk-integration-tests/pom.xml index 1721103..7c86c0c 100644 --- a/sdk-integration-tests/pom.xml +++ b/sdk-integration-tests/pom.xml @@ -5,7 +5,7 @@ com.kount kount-java-parent - 7.3.12 + 7.4.0 sdk-integration-tests