hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Shettleroe" <aaron.shettle...@touchnet.com>
Subject Duplicate requests
Date Wed, 02 Apr 2008 15:32:15 GMT
It appears that HttpClient is sending the same request more than once.
I tried to code against this.

Here is some code snippets:

private static HttpClient httpClient;

final HttpConnectionManagerParams params =
            new HttpConnectionManagerParams();
// set some params: timeouts, max conns

final MultiThreadedHttpConnectionManager connectionManager = 
   new MultiThreadedHttpConnectionManager();
httpClient = new HttpClient(connectionManager);


// I define a RetryHandler


// My retry logic.  Only retry if a connection exception:
// Don't retry if the maximum retry count has been reached
if(executionCount >= MAX_RETRY_COUNT)
   return false;
else if(!method.isRequestSent()
          && (exception instanceof ConnectException
              || exception instanceof ConnectTimeoutException))
   return true;

return false;

However, the request is being sent more than once.

Would the stale checking be the cause of this?  Does the stale checking
actually send the request?

To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

View raw message