Java based HTTP Client which supports Pipelining

后端 未结 4 1282
既然无缘
既然无缘 2020-12-19 20:31

Do you know of any free Java library which support the HTTP pipelining option of HTTP/1.1 ( http://en.wikipedia.org/wiki/HTTP_pipelining ) ?

相关标签:
4条回答
  • 2020-12-19 20:37

    I realize my answer is about a year old, but as this is one of the top links for "java http pipelining", I thought it was relevant.

    Hotpotato does indeed now support pipelining, and in my limited experience it's been working great so far. Also has a nice API to boot.

    http://hotpotato.biasedbit.com/

    EDIT: Looks like this project is now unmaintained and the author recommends the Async HTTP client: https://github.com/ning/async-http-client/

    0 讨论(0)
  • 2020-12-19 20:50

    hotpotato will support pipelining really soon. Performance-wise, it's way superior to Apache's HTTP Client, especially in high concurrency environments (multiple threads using the same instance of the client).

    I still need to publish the results but on a LAN test, I'm getting ~7000req/s (hotpotato) vs ~100req/s (apache's). Of course, a great deal of the merit must go to Netty, the amazing framework hotpotato is built upon ;)

    If you don't need a fancy full-fledged client, take a look here for a simpler version.

    0 讨论(0)
  • 2020-12-19 20:54

    HTTPClient apparently supports pipelining here:

    http://www.innovation.ch/java/HTTPClient/

    but I haven't tried it personally and can't verify this.

    0 讨论(0)
  • 2020-12-19 20:58

    I don't think you will find any common ones supporting pipe-lining. Jetty HttpClient seems to support it from document but I couldn't make it to do it.

    Please note that Pipeline is different from keep-alive. Keep-alive just means reuse the connection but it may still send only one request at a time over the connection. With pipe-lining, you can send several requests at the same time over the same connection and wait for their respective responses.

    0 讨论(0)
提交回复
热议问题