Details
-
New Feature
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
4.0.3
-
None
-
None
Description
HttpClient has connect timeout and read timeout. I also need a "query timeout" parameter.
Have a situation:
We are some server "B". Client "A" calls us with timeout 10s. To serve requests we call some internal HTTP service "C":
A -> B -> C
HttpClient is used to call C from B.
Our call to that service "C" should be completed within 9s or should be interrupted, because:
- client "A" should get meaningful error message instead of just socket timeout
- we should not consume server resources (threads, connection) after client "A" stopped a request
This behavior cannot be implemented with just connect timeout + socket timeout. For example, if socket timeout is 5 seconds, and client sends 1 byte portions, socket timeout won't happen for a long time.
So I'm requesting "query timeout" parameter. It's value is a system time (milliseconds since epoch). HttpClient should execute request with respect to connect timeout and socket timeout as usual, but if "query timeout" time has come, HttpClient throws an exception.
AFAIU, this behavior can be now achieved by using a extra thread and abort() method.
Attachments
Issue Links
- is duplicated by
-
HTTPASYNC-149 HttpAsyncClient doesn't support hard request timeout
- Resolved
-
HTTPCLIENT-2169 Support to provide complete request/call timeout option
- Resolved