Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Most likely you are not going to like the answer, but so be it. The reason why support for HTTP pipelining is lacking is that HTTP pipelining is simply not useful outside a very limited number of use cases. HTTP pipelining is applicable (or recommended by the HTTP spec) for non-idempotent HTTP methods only. This effectively precludes pipelining of POST requests. Pipelining can be marginally useful for browsers that need to retrieve a large sets of <em>static</em> files using GET requests while being restricted to only <em>two</em> simultaneous HTTP connections to the same host. In this case HTTP pipelining may produce marginal performance improvements. At the same time I contend that an HTTP agent using a moderately sized pool of persistent connections (no more than five) will outperform pipelining HTTP agent. The extra complexity of HTTP pipelining is simply not worth the trouble and this is the reason why there is no great urgency to add out-of-box support for HTTP pipelining to HttpClient and HttpCore.</p> <p>Having said all that non-blocking HTTP connections of HttpCore NIO are fully asynchronous and always function in a full duplex mode. HttpCore imposes no restriction as to how many requests can be written out or how many responses can be received in one go. It is the responsibility of the protocol handler to correlate HTTP requests and responses into logically related sequences of message exchanges. Standard HTTP protocol handlers do not pipeline HTTP messages in order to be able to support the expect-continue handshaking for POST requests (expectation verification and pipelining are pretty much mutually exclusive). However, there is nothing that prevents you from building a custom <code>NHttpClientHandler</code> class and making it pipeline requests. You can start off by taking the source code of HttpAsyncClientProtocolHandler [1], rip out the expect-continue handshaking code and add queuing of incoming and outgoing HTTP messages.</p> <p>Hope this helps</p> <p>[1] <a href="http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncClientProtocolHandler.java" rel="nofollow">http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncClientProtocolHandler.java</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload