Rapidoid - Extremely Fast, Simple and Powerful Java Web Framework!

Open source (Apache license). View benchmark... Community: [email protected]

Rapidoid consists of several modules which can be used separately or together:
Add rapidoid-net as Maven dependency:
<dependency>
    <groupId>org.rapidoid</groupId>
    <artifactId>rapidoid-net</artifactId>
    <version>5.4.4</version>
</dependency>
docker run rapidoid --help
Module rapidoid-net

Network protocol framework

Built on top of Java NIO from scratch

The low-level HTTP API provides access to the extremely fast Rapidoid HTTP server components.

Rapidoid is implemented on top of Java NIO, without native libraries, nor external dependencies.

It is great to see how Java performance can match C++ and outperform all the other languages in network programming.

Designed for performance from day 1

Rapidoid was designed for high performance since its inception, and several parts of it played a critical role:

  • asynchronous I/O processing,
  • minimizing the garbage collection pressure,
  • fast object pools,
  • reusable off-heap buffers,
  • very fast and efficient HTTP parser,
  • and many other optimizations.

Rapidoid as a Network Protocol Framework

You can use Rapidoid as a Network Protocol Framework, to implement your custom TCP-based protocols.

For a quick and easy start, please take a look at the Echo protocol example.

Echo.java
import org.rapidoid.net.TCP;
 
public class Echo {
 
    public static void main(String[] args) throws Exception {
        TCP.server().protocol(new EchoProtocol()).port(5555).build().start();
    }
 
}
EchoProtocol.java
import org.rapidoid.net.Protocol;
import org.rapidoid.net.abstracts.Channel;
 
public class EchoProtocol implements Protocol {
 
    @Override
    public void process(Channel ctx) {
        String line = ctx.readln().toUpperCase();
        ctx.write(line).write(CR_LF);
        ctx.closeIf(line.equals("BYE"));
    }
 
}