Merge pull request #2584 from wolfgangzhu/hotifx/back_issue
[ISSUE#2577] Fix naming client http read timeout and connect timeout properties
This commit is contained in:
commit
4e52ff050a
@ -38,8 +38,8 @@ import static com.alibaba.nacos.client.utils.LogUtils.NAMING_LOGGER;
|
|||||||
*/
|
*/
|
||||||
public class HttpClient {
|
public class HttpClient {
|
||||||
|
|
||||||
public static final int TIME_OUT_MILLIS = Integer
|
public static final int READ_TIME_OUT_MILLIS = Integer
|
||||||
.getInteger("com.alibaba.nacos.client.naming.ctimeout", 50000);
|
.getInteger("com.alibaba.nacos.client.naming.rtimeout", 50000);
|
||||||
public static final int CON_TIME_OUT_MILLIS = Integer
|
public static final int CON_TIME_OUT_MILLIS = Integer
|
||||||
.getInteger("com.alibaba.nacos.client.naming.ctimeout", 3000);
|
.getInteger("com.alibaba.nacos.client.naming.ctimeout", 3000);
|
||||||
private static final boolean ENABLE_HTTPS = Boolean
|
private static final boolean ENABLE_HTTPS = Boolean
|
||||||
@ -73,7 +73,7 @@ public class HttpClient {
|
|||||||
|
|
||||||
setHeaders(conn, headers, encoding);
|
setHeaders(conn, headers, encoding);
|
||||||
conn.setConnectTimeout(CON_TIME_OUT_MILLIS);
|
conn.setConnectTimeout(CON_TIME_OUT_MILLIS);
|
||||||
conn.setReadTimeout(TIME_OUT_MILLIS);
|
conn.setReadTimeout(READ_TIME_OUT_MILLIS);
|
||||||
conn.setRequestMethod(method);
|
conn.setRequestMethod(method);
|
||||||
conn.setDoOutput(true);
|
conn.setDoOutput(true);
|
||||||
if (StringUtils.isNotBlank(body)) {
|
if (StringUtils.isNotBlank(body)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user