finds.dev

Snailclimb/guide-rpc-framework

A custom RPC framework implemented by Netty+Kyro+Zookeeper.(一款基于 Netty+Kyro+Zookeeper 实现的自定义 RPC 框架-附详细实现过程和相关教程。)

View on GitHubHomepage ↗

★ 4,417JavaNOASSERTIONupdated Sep 2025

// the take

A teaching project that walks through building an RPC framework from scratch in Java, using Netty for transport, Kryo for serialization, and Zookeeper for service discovery. It's explicitly aimed at students and job seekers who want to understand how Dubbo-style frameworks work under the hood, not at anyone running it in production.

The custom wire protocol is done properly — magic bytes, message type, serializer ID, and length prefix in the header, which is how you actually avoid half the bugs in naive Netty implementations. The SPI extension system mirrors Dubbo's design closely enough that understanding one helps you read the other. Channel reuse via ChannelProvider avoids the common beginner mistake of opening a new connection per request. The Spring annotation integration (@RpcService, @RpcReference, @RpcScan) gives you a realistic feel for how framework authors hook into the BeanPostProcessor lifecycle.

Zookeeper as the only registry option is hardcoded throughout the service discovery layer — the SPI wiring exists but swapping in Nacos or etcd would require more than just a new implementation class. There are no integration tests that actually exercise the Netty path end-to-end; the test suite covers serializers and load balancers in isolation but not the full request/response roundtrip. Error handling on the client side is thin: if the server throws, you get the exception back, but connection failures and timeouts mostly bubble up as unhandled futures. Configuration is still largely properties-file-based with hardcoded defaults scattered in constants, which the README acknowledges as a known gap.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
4,417
Forks
2,164
Language
Java
License
NOASSERTION
Last commit
30 Sep 2025

// nearby

If guide-rpc-framework isn't quite it.

All repos →