From 667d486899b90a1d11e717ef5759c91b5760657e Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Sat, 26 Aug 2017 14:02:07 +0800 Subject: [PATCH] =?UTF-8?q?httpclient=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/xxl/job/core/util/HttpClientUtil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/util/HttpClientUtil.java b/xxl-job-core/src/main/java/com/xxl/job/core/util/HttpClientUtil.java index fe0c1309..00b646ba 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/util/HttpClientUtil.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/util/HttpClientUtil.java @@ -30,7 +30,9 @@ public class HttpClientUtil { byte[] responseBytes = null; HttpPost httpPost = new HttpPost(reqURL); - CloseableHttpClient httpClient = HttpClients.createDefault(); + //CloseableHttpClient httpClient = HttpClients.createDefault(); + CloseableHttpClient httpClient = HttpClients.custom().disableAutomaticRetries().build(); // disable retry + try { // init post /*if (params != null && !params.isEmpty()) { @@ -62,7 +64,7 @@ public class HttpClientUtil { EntityUtils.consume(entity); } } catch (Exception e) { - logger.error(e.getMessage(), e); + logger.error("", e); throw e; } finally { httpPost.releaseConnection();