Commit 667d4868 by xuxueli

httpclient防止重复提交

parent 837ab404
...@@ -30,7 +30,9 @@ public class HttpClientUtil { ...@@ -30,7 +30,9 @@ public class HttpClientUtil {
byte[] responseBytes = null; byte[] responseBytes = null;
HttpPost httpPost = new HttpPost(reqURL); HttpPost httpPost = new HttpPost(reqURL);
CloseableHttpClient httpClient = HttpClients.createDefault(); //CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpClient httpClient = HttpClients.custom().disableAutomaticRetries().build(); // disable retry
try { try {
// init post // init post
/*if (params != null && !params.isEmpty()) { /*if (params != null && !params.isEmpty()) {
...@@ -62,7 +64,7 @@ public class HttpClientUtil { ...@@ -62,7 +64,7 @@ public class HttpClientUtil {
EntityUtils.consume(entity); EntityUtils.consume(entity);
} }
} catch (Exception e) { } catch (Exception e) {
logger.error(e.getMessage(), e); logger.error("", e);
throw e; throw e;
} finally { } finally {
httpPost.releaseConnection(); httpPost.releaseConnection();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment