Skip to main content

Overview

ActiveJ RPC is a lightweight and convenient Java library for developing high-load distributed applications and Memcached-like solutions. It introduces a completely alternative approach to microservices implementation and overcomes the overheads of utilizing HTTP protocol with JSON or XML encoding. ActiveJ RPC is powered by world's fastest JVM serializer ActiveJ Serializer, runs on TCP, supports pipelined requests and has a custom high-performance binary streaming protocol. Along with that, ActiveJ RPC utilizes Datastream module for asynchronous data processing and back pressure control. It also features built-in commonly used RPC strategies and high fault tolerance.

Why ActiveJ RPC?#

  • Outstanding performance of up to ~15M requests per second on a single CPU core
  • Simple API for defining client and server message handlers
  • Wide range of RPC strategies (first available, round-robin, rendezvous hashing, etc.) that can be simply combined
  • Custom high-performance streaming protocol
  • Utilizes ActiveJ's Datastream, Net and Serializer modules to achieve top performance
  • Fault tolerance with re-connections to fallback and replica servers
  • Native support for message pipelining
  • Ideal for near-real time servers with application-specific business logic
  • Tested in a high-load production environment

Asynchronous binary RPC protocol with extensive cloud strategies#

ActiveJ RPC features highly optimized flexible server and client implementation along with predefined cloud strategies. With these technologies you can conveniently create even complex scalable solutions like high-performance microservices or Memcached-like servers.

RpcServer rpcServer(Eventloop eventloop) {
return RpcServer.create(eventloop)
.withMessageTypes(String.class)
.withHandler(String.class, String.class,
request -> Promise.of("Hello " + request))
.withListenPort(SERVICE_PORT);
}
RpcClient rpcClient(Eventloop eventloop) {
return RpcClient.create(eventloop)
.withMessageTypes(String.class)
.withStrategy(server(new InetSocketAddress(SERVICE_PORT)));
}
rpcClient.sendRequest("World")
.whenResult(response -> System.out.println(response)); // prints "Hello World"

Add ActiveJ RPC to your project#

You can add ActiveJ RPC to your project by importing its Maven repository. These docs cover the most recent release of ActiveJ RPC v4.3 (see on Github or Maven).