Search code examples
javahttpclient-servernio

Embedded NIO http client/server in Java


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?


Solution

    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