Introduce Quick RPC

Updated at 1685687562000

1. Introduct to Quick RPC

QuickRPC is an open source high performance RPC framework. It can proper to connect services in your system. It also suitable for load balancing, tracing, health checking and authentication.

2. Import Quick RPC

To create a Quick RPC server application we need add dependency To use Quick RPC client we need add dependency

<dependency>
    <groupId>com.tvd12</groupId>
    <artifactId>quick-rpc-server</artifactId>
    <version>${quickRpcVersion}</version>
</dependency>
<dependency>
    <groupId>com.tvd12</groupId>
    <artifactId>quick-rpc-client</artifactId>
    <version>${quickRpcVersion}</version>
</dependency>

The latest version can be found in the Maven Central repository.

3. Create and start a Quick RPC server

    RpcRequestHandlerImplementer.setDebug(true);
    QuickRpcSettings settings = QuickRpcSettings.builder()
            .username("admin")
            .password("admin")
            .build();
    QuickRpcServer server = new QuickRpcServer(settings)
            .scan("com.tvd12.quick.rpc.examples.hello_world");
    server.start();

4. Create a Quick RPC client

    QuickRpcClient client = QuickRpcClient.builder()
            .scan("com.tvd12.quick.rpc.examples.hello_world.data")
            .build();

5. Send a request

    GreetResponse response = client.call(
        new GreetRequest("World"), 
        GreetResponse.class
    );

For full example, you can look at on Github

6. Conclusion

Quick RPC is a good choice to replace Rest API and Message Queue for RPC. It really simple to use but is highest performance.