Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d905e4fa
authored
Jun 30, 2016
by
xueli.xue
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:禁用httpclient底层retry策略;
parent
70783426
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
xxl-job-core/src/main/java/com/xxl/job/core/util/HttpUtil.java
xxl-job-core/src/main/java/com/xxl/job/core/util/HttpUtil.java
View file @
d905e4fa
...
@@ -67,7 +67,6 @@ public class HttpUtil {
...
@@ -67,7 +67,6 @@ public class HttpUtil {
CloseableHttpClient
httpClient
=
null
;
CloseableHttpClient
httpClient
=
null
;
try
{
try
{
httpPost
=
new
HttpPost
(
reqURL
);
httpPost
=
new
HttpPost
(
reqURL
);
httpClient
=
HttpClients
.
createDefault
();
if
(
params
!=
null
&&
!
params
.
isEmpty
())
{
if
(
params
!=
null
&&
!
params
.
isEmpty
())
{
List
<
NameValuePair
>
formParams
=
new
ArrayList
<
NameValuePair
>();
List
<
NameValuePair
>
formParams
=
new
ArrayList
<
NameValuePair
>();
for
(
Map
.
Entry
<
String
,
String
>
entry
:
params
.
entrySet
()){
for
(
Map
.
Entry
<
String
,
String
>
entry
:
params
.
entrySet
()){
...
@@ -78,6 +77,9 @@ public class HttpUtil {
...
@@ -78,6 +77,9 @@ public class HttpUtil {
RequestConfig
requestConfig
=
RequestConfig
.
custom
().
setSocketTimeout
(
5000
).
setConnectTimeout
(
5000
).
build
();
RequestConfig
requestConfig
=
RequestConfig
.
custom
().
setSocketTimeout
(
5000
).
setConnectTimeout
(
5000
).
build
();
httpPost
.
setConfig
(
requestConfig
);
httpPost
.
setConfig
(
requestConfig
);
//httpClient = HttpClients.createDefault(); // default retry 3 times
httpClient
=
HttpClients
.
custom
().
disableAutomaticRetries
().
build
();
HttpResponse
response
=
httpClient
.
execute
(
httpPost
);
HttpResponse
response
=
httpClient
.
execute
(
httpPost
);
HttpEntity
entity
=
response
.
getEntity
();
HttpEntity
entity
=
response
.
getEntity
();
if
(
response
.
getStatusLine
().
getStatusCode
()
==
200
)
{
if
(
response
.
getStatusLine
().
getStatusCode
()
==
200
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment