explaingit

snailclimb/guide-rpc-framework

4,421JavaAudience · developerComplexity · 4/5Setup · moderate

TLDR

A Java learning project that builds a simplified RPC framework from scratch using Netty, Kryo, and Zookeeper, showing how remote procedure calls work end-to-end without the complexity of production systems.

Mindmap

mindmap
  root((guide-rpc))
    Core components
      Netty networking
      Kryo serialization
      Zookeeper registry
    Features
      Load balancing
      Heartbeat keepalive
      Spring annotations
      Service versioning
    How to use
      @RpcService annotation
      @RpcReference annotation
      Start Zookeeper first
    Purpose
      Learning project
      Fork and extend
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Study how an RPC framework works by reading through a clean, minimal Java implementation built from scratch.

USE CASE 2

Expose a Java class as a remote service with a single @RpcService annotation and call it from another machine with @RpcReference.

USE CASE 3

Learn how service discovery, load balancing, and serialization work together in a distributed system.

USE CASE 4

Fork the project and add features like a monitoring dashboard or new load balancing strategies as a hands-on exercise.

Tech stack

JavaNettyKryoZookeeperSpring

Getting it running

Difficulty · moderate Time to first run · 1h+

Requires a running Zookeeper instance before starting the server or client.

License terms are not described in the explanation, check the repository directly.

In plain English

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.

Copy-paste prompts

Prompt 1
Walk me through how guide-rpc-framework registers a Java service with Zookeeper using @RpcService and how clients discover it at runtime.
Prompt 2
Explain how Kryo serialization works in guide-rpc-framework to convert Java objects into bytes for network transmission and back.
Prompt 3
How does guide-rpc-framework balance load across multiple servers offering the same service? Show me where that logic lives in the code.
Prompt 4
I want to add a new load balancing strategy to guide-rpc-framework. What interface do I need to implement and where do I register it?
Prompt 5
How does the heartbeat mechanism in guide-rpc-framework keep connections alive between client and server?
Open on GitHub → Explain another repo

← snailclimb on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.