Skip to content

scalecube/reactor-aeron

 
 

Repository files navigation

Reactor Aeron

Reactor Aeron offers non-blocking and backpressure-ready relable UDP clients & servers based on Aeron Efficient reliable UDP unicast, UDP multicast, and IPC message transport. it is inspired by reactor-netty

Getting it

Reactor Aeron requires Java 8 or + to run.

With Maven from Maven Central repositories (stable releases only):

<!-- https://mvnrepository.com/artifact/io.scalecube/scalecube-reactor-aeron -->
<dependency>
    <groupId>io.scalecube</groupId>
    <artifactId>reactor-aeron</artifactId>
    <version>x.y.z</version>
    <type>pom</type>
</dependency>

Getting Started

Here is a very simple server and the corresponding client example

  AeronResources resources = new AeronResources().useTmpDir().start().block();

  AeronServer.create(resources)
    .options("localhost", 13000, 13001)
    .handle(
        connection ->
            connection
                .inbound()
                .receive()
                .asString()
                .log("receive")
                .then(connection.onDispose()))
    .bind()
    .block()
    .onDispose(resources)
    .onDispose()
    .block();
    
    AeronResources resources = new AeronResources().useTmpDir().start().block();

    AeronClient.create(resources)
        .options("localhost", 13000, 13001)
        .handle(
            connection1 -> {
              System.out.println("Handler invoked");
              return connection1
                  .outbound()
                  .sendString(Flux.fromStream(Stream.of("Hello", "world!")).log("send"))
                  .then(connection1.onDispose());
            })
        .connect()
        .block()
        .onDispose(resources)
        .onDispose()
        .block();

Building from Source

$ git clone git@github.com:scalecube/reactor-aeron.git
$ cd reactor-aeron
$ mvn clean install

Performance results

Performance is the key focus. Aeron is designed to be the highest throughput with the lowest and most predictable latency possible of any messaging system.

Benchmark: reactor-aeron vs reactor-netty vs pure-aeron vs rsocket running on AWS C5.xlarge

Code style

See the reference on scalecube site

License

Reactor Aeron is Open Source Software released under the Apache License 2.0