Study how an RPC framework works by reading through a clean, minimal Java implementation built from scratch.
Expose a Java class as a remote service with a single @RpcService annotation and call it from another machine with @RpcReference.
Learn how service discovery, load balancing, and serialization work together in a distributed system.
Fork the project and add features like a monitoring dashboard or new load balancing strategies as a hands-on exercise.
Requires a running Zookeeper instance before starting the server or client.
guide-rpc-framework is a Java project that teaches how a Remote Procedure Call (RPC) framework works by building a simplified one from scratch. An RPC framework lets one program call a function on a different computer as if that function were running locally, hiding all the network communication underneath. This project is intended as a learning exercise rather than a production tool. The framework is built on three main components. Netty handles the fast, non-blocking network communication between a client and a server. Kryo handles serialization, which is the process of turning Java objects into bytes that can be sent over a network and then reassembled on the other side. Zookeeper acts as a service registry, a kind of directory where servers announce which services they offer and clients look up where to find them. Beyond the basics, the project includes load balancing so requests can spread across multiple servers running the same service, a heartbeat mechanism to keep connections alive, Spring annotation support so you can mark a class as a service provider or consumer with a single tag, and versioning so different implementations of the same service interface can coexist. To use it, you start a Zookeeper instance, annotate a Java class with @RpcService to expose it as a remote service, then annotate a field in another class with @RpcReference to call that service. The framework handles everything in between: registering the service, discovering it on the network, routing the call, and returning the result. The author is clear that this is a study project and encourages readers to fork it and extend it. Suggested improvements include better configuration, a monitoring dashboard, and additional tests. For production systems, the README recommends using a mature framework like Apache Dubbo instead.
← snailclimb on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.