mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3175 - configurable soTimeout for http(s) transport
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1068880 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ab412fa136
commit
1a409b097d
|
@ -59,6 +59,8 @@ public class HttpClientTransport extends HttpTransportSupport {
|
|||
private boolean trace;
|
||||
private GetMethod httpMethod;
|
||||
private volatile int receiveCounter;
|
||||
|
||||
private int soTimeout = MAX_CLIENT_TIMEOUT;
|
||||
|
||||
public HttpClientTransport(TextWireFormat wireFormat, URI remoteUrl) {
|
||||
super(wireFormat, remoteUrl);
|
||||
|
@ -84,7 +86,7 @@ public class HttpClientTransport extends HttpTransportSupport {
|
|||
|
||||
HttpClient client = getSendHttpClient();
|
||||
HttpClientParams params = new HttpClientParams();
|
||||
params.setSoTimeout(MAX_CLIENT_TIMEOUT);
|
||||
params.setSoTimeout(soTimeout);
|
||||
client.setParams(params);
|
||||
int answer = client.executeMethod(httpMethod);
|
||||
if (answer != HttpStatus.SC_OK) {
|
||||
|
@ -227,4 +229,11 @@ public class HttpClientTransport extends HttpTransportSupport {
|
|||
return receiveCounter;
|
||||
}
|
||||
|
||||
public int getSoTimeout() {
|
||||
return soTimeout;
|
||||
}
|
||||
|
||||
public void setSoTimeout(int soTimeout) {
|
||||
this.soTimeout = soTimeout;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue