I am new to HTTPComponents Client but have been using HttpClient 3.1 very
extensively... So I am facing some migration work.

1. How do I measure the time it took to get a response in a multithreaded
scenario with a limited size of max total connections?

In 3.1 I had to hack this into a custom ProtocolSocketFactory. When the
socket is created I am rembering the time in a thread local scope.

Is that still the way to go?


2. I want to set a different user agent per request

In 3.1 I could set HostParams when executing the method. How does it work
now?


3. Setting a proxy per request

httpClient.execute(proxyHost, httpget, responseHandler);

Correct?


4. Disabling redirects

params.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, false);

Correct?


5. Enabling my own retry handler (which I just need because of verbose
logging)

((DefaultHttpClient) this.httpClient).setHttpRequestRetryHandler(XXX);

Correct?


6. When using the ThreadSafeClientConnManager how can I monitor the number
of threads used or threads waiting?

I guess the ThreadSafeClientConnManager is the replacement of the
MultiThreadedHttpConnectionManager?


Help appreciated...

Reply via email to