HTTP client with NIO2

Someone familiar with the HTTP client, which is based on JDK7 and NIO2, an implementation using: AsynchronousSocketChannel

I am looking for an implementation that is based on NIO2 and can scale an unlimited number of thousands of HTTP requests at the same time.

NOTES:

  • please do not offer me an implementation based on NIO1, e.g. Apache :: AsyncHTTPClient and JBOSS :: Netty framework

  • Please do not offer me a solution based on a common solution, I'm looking for one client that could handle all HTTP requests efficiently.

THANKS!

+6
source share
2 answers

I believe that you are mistaken in your assumption that you should use NIO2 to increase. Please listen!

NIO2 is a non-blocking version of Java IO. This means that it’s easier to write high-performance io in NIO2 because you don’t have to start and manage threads, because most of your threads just wait for I / O. Multi-threaded programming is complicated, so everything that makes the task easier is a function, that's why NIO2.

However, as a library user, how difficult it is to write a library is not your problem. Modern JVMs can handle many threads, and the old io API should be powerful when used by experienced programmers. Since you are a library user, I suggest you find the fastest library.

Apache's HTTPClient is a very popular library. I suggest that you contact the experts on this subject and ask them your questions about performance. I am not an expert in this field, so I am not telling you that HTTPClient is the best, I am just saying so as not to count it, and that talking to people HTTPClient would be a good place to start.

Luck

+4
source

I would recommend checking out AsyncHttpClient . This was written by a guy who wrote grizzy for Sun and now works for a sonata:
https://github.com/sonatype/async-http-client

+3
source

Source: https://habr.com/ru/post/897641/


All Articles