finds.dev← search

// the find

Snailclimb/guide-rpc-framework

★ 4,417 · Java · NOASSERTION · updated Sep 2025

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

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.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →