Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedded NIO http client/server in Java [closed]

I am developing an application, which communicates with other applications with REST services, i.e. expose REST services of their own and consumes other REST services. In other words the application works as both an http server and client.

Currently I use Jetty embedded web server and Apache HttpClient. Now I wonder if it would not be easier to use one single-threaded component, which handles all inbound/outbound HTTP requests/responses in non-blocking mode using Java NIO?

Does it make sense? Do you know about an open source library, which does that?

like image 502
Michael Avatar asked Oct 08 '22 14:10

Michael


2 Answers

  1. Simple - it is a project, which goal is to provide a truly embeddable Java based HTTP engine capable of handling enormous loads. It works, it's easy to embed and it can handle quite a load.
  2. IceBreak REST - very, very small and very capable.
  3. Restlet - it got an internal connector, but I'm not sure if it is capable of taking a lot of requests.
  4. I have no idea how the application was developed, but if You used Jersey, there are few ways You can run the server, like Grizzly container, Jersey simple server and light weight HTTP server. All in docs
like image 198
Łukasz Rżanek Avatar answered Oct 13 '22 04:10

Łukasz Rżanek


You might consider using Jetty Client instead of Apache HttpClient if you want to have Jetty only solution.

Other alternatives could be

  • Netty
  • Apache HttpCore
like image 42
ok2c Avatar answered Oct 13 '22 04:10

ok2c