Overview
ActiveJ RPC is a lightweight and easy-to-use Java library for developing high-load distributed applications and Memcached-like solutions. It overcomes the overheads of using JSON or XML encoding over HTTP. ActiveJ RPC is powered by one of the fastest JVM serializers (ActiveJ Serializer), runs on TCP, supports request pipelining and has itw own high-performance binary streaming protocol. Along with that, ActiveJ RPC uses Datastream module for asynchronous data processing and back-pressure control. It also has built-in commonly used RPC strategies and high fault tolerance.
Why ActiveJ RPC?
- Performance of up to ~15M requests per second on a single CPU core
- A simple API for defining client and server message handlers
- A wide range of RPC strategies (first available, round-robin, rendezvous hashing, etc.) that can be easily combined
- Custom fast data streaming protocol
- Utilizes ActiveJ's Datastream, Net and Serializer modules to achieve high performance
- Fault tolerance with reconnections to fallback and replica servers
- Built-in 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 implementations, as well as predefined cloud strategies. Even complex, scalable solutions such as high-performance microservices or Memcached-like servers can be conveniently built with these technologies.
@Provides
RpcServer rpcServer(NioReactor reactor) {
return RpcServer.builder(reactor)
.withMessageTypes(String.class)
.withHandler(String.class,
request -> Promise.of("Hello " + request))
.withListenPort(SERVICE_PORT)
.build();
}
@Provides
IRpcClient rpcClient(NioReactor reactor) {
return RpcClient.builder(reactor)
.withMessageTypes(String.class)
.withStrategy(server(new InetSocketAddress(SERVICE_PORT)))
.build();
}
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 v6.0-beta2 (see on Github or Maven).