- HttpAsyncClients 利用 NIO 实现异步非阻塞 IO
- HttpClients 利用 BIO 实现同步阻塞 IO
- PoolingHttpClientConnectionManager BIO
- PoolingNHttpClientConnectionManager NIO
每个 host 建立连接后 keep alive,之后所有该 host 的请求使用同一个连接
参考 Chapter 2. Connection management 2.4. Multithreaded request execution
需要在建立请求时使用多线程
- MultipartEntity
MultipartEntity is inherently blocking. It can only generate its content
by writing it out to an OutputStream through #writeTo() method. It does
not support #getContent() method, which makes it impossible to use with
a non-blocking I/O model without buffering.
You can wrap the MultipartEntity instance with BufferedHttpEntity in
order to make it compatible with the HttpAsyncClient's non-blocking I/O
model.
- EntityAsyncContentProducer
- BufferedHttpEntity