Skip to content

Commit 4dbb690

Browse files
committed
更新readme
1 parent 480d8e1 commit 4dbb690

3 files changed

Lines changed: 36 additions & 16 deletions

File tree

‎README.md‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ The project is organized into the following modules to ensure separation of conc
3131
| **`rpc-transport-netty`** | The default transport implementation based on **Netty**. |
3232
| **`rpc-provider`** | Example provider application that implements and exports services. |
3333
| **`rpc-consumer`** | Example consumer application that imports and invokes services. |
34+
| **`rpc-spring-boot-starter`** | Spring Boot auto-configuration starter for provider/consumer integration. |
3435
| **`rpc-benchmark`** | Performance benchmarking module using JMH (Java Microbenchmark Harness). |
3536
| **`python_client`** | Python client implementation demonstrating cross-language gRPC interoperability. |
37+
| **`go_client`** | Go client implementation demonstrating cross-language gRPC interoperability. |
3638

3739
## ✨ Key Features
3840

@@ -49,7 +51,7 @@ The project is organized into the following modules to ensure separation of conc
4951

5052
---
5153

52-
## Quick Start
54+
## Quick Start
5355

5456
### 1. Prerequisites (Nacos)
5557

@@ -67,6 +69,9 @@ docker run --name nacos-standalone \
6769

6870
Execute the following commands to start the Java RPC Provider. This will build the project and register the `HelloService` to your local Nacos instance.
6971

72+
The default `rpc.protocol` is `netty` for Java-to-Java Provider/Consumer calls.
73+
If you need Python/Go interoperability, switch to `grpc` in `rpc-core/src/main/resources/rpc-config.yaml`.
74+
7075
```bash
7176
# 1. Build Project
7277
mvn clean package -DskipTests
@@ -96,7 +101,7 @@ mvn test -pl rpc-core,rpc-transport-netty
96101
Run the full integration test suite:
97102

98103
```bash
99-
mvn test -pl rpc-consumer -Dtest=FullIntegrationTest
104+
mvn test -pl rpc-consumer -am -Dtest=FullIntegrationTest
100105
```
101106

102107
### 5. Performance & Benchmark Results
@@ -138,17 +143,22 @@ Configure the framework via `rpc-core/src/main/resources/rpc-config.yaml`.
138143

139144
```yaml
140145
rpc:
141-
transport: "netty" # Transport: netty (default)
142-
protocol: "http2" # Protocol: netty, http, http2
143-
server-host: 127.0.0.1
146+
transport: "netty" # Transport: netty
147+
protocol: "netty" # Protocol: netty, http, http2
148+
server-host: "127.0.0.1"
144149
server-port: 8080
145150
registry: "nacos" # Registry: nacos, local
146151
registry-address: "127.0.0.1:8848"
147-
serializer: KRYO # Serializer: PROTOBUF, KRYO, JAVA, JSON
148-
proxy: bytebuddy # Proxy: jdk, bytebuddy
152+
serializer: "protobuf" # Serializer: protobuf, kryo, java, json
153+
proxy: "bytebuddy" # Proxy: jdk, bytebuddy
149154
load-balancer: roundrobin # Load Balancer: roundrobin, random
155+
max-message-size: 8388608 # 8MB
150156
```
151157
158+
> [!IMPORTANT]
159+
> Use `netty`/`http`/`http2` with `rpc-consumer` (`RpcClientProxy`).
160+
> Switch to `grpc` only when interoperating with standard grpc clients (Python/Go).
161+
152162
## 🔌 SPI Design & Ecosystem
153163

154164
XiaoYu RPC adheres to the **Microkernel Architecture**, where the core (`rpc-core`) only provides the lifecycle management and SPI (Service Provider Interface) definitions, while all specific functionalities are implemented as plugins. This design ensures the framework is highly extensible, lightweight, and follows the **Open-Closed Principle**.
@@ -289,7 +299,7 @@ This framework supports interoperability with standard gRPC clients (e.g., Pytho
289299
java -cp rpc-provider/target/rpc-provider-1.0-SNAPSHOT.jar:rpc-transport-netty/target/rpc-transport-netty-1.0-SNAPSHOT.jar:rpc-core/target/rpc-core-1.0-SNAPSHOT.jar:rpc-common/target/rpc-common-1.0-SNAPSHOT.jar:rpc-api/target/rpc-api-1.0-SNAPSHOT.jar:$(mvn -q dependency:build-classpath -Dmdep.outputFile=/dev/stdout -pl rpc-provider -am) com.xiaoyu.rpc.provider.ProviderApp
290300
```
291301
3. **Run the Python Client**:
292-
Refer to [python_client/client.py](file:///Users/yaoyao/Dev/JAVA_Dev_Project/gRPC/python_client/client.py) for details.
302+
Refer to [`python_client/client.py`](python_client/client.py) for details.
293303

294304
```bash
295305
cd python_client

‎README_ZH.md‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
| **`rpc-transport-netty`** | 基于 **Netty** 实现的默认传输层模块。 |
3131
| **`rpc-provider`** | 示例服务提供者应用,用于实现并暴露服务。 |
3232
| **`rpc-consumer`** | 示例服务消费者应用,用于引入并调用服务。 |
33+
| **`rpc-spring-boot-starter`** | Spring Boot 自动配置 Starter,便于集成 Provider/Consumer。 |
3334
| **`rpc-benchmark`** | 基于 JMH (Java Microbenchmark Harness) 的性能基准测试模块。 |
3435
| **`python_client`** | Python 客户端实现,用于演示跨语言 gRPC 互操作性。 |
36+
| **`go_client`** | Go 客户端实现,用于演示跨语言 gRPC 互操作性。 |
3537

3638
## ✨ 核心特性
3739

@@ -105,6 +107,9 @@ docker run --name nacos-standalone \
105107

106108
执行以下命令启动 Java RPC Provider。这将编译项目并将 `HelloService` 注册到本地 Nacos 实例。
107109

110+
默认 `rpc.protocol` 已设置为 `netty`,用于 Java-to-Java 的 Provider/Consumer 调用。
111+
若需要 Python/Go 跨语言互通,请在 `rpc-core/src/main/resources/rpc-config.yaml` 中手动切换到 `grpc`。
112+
108113
```bash
109114
# 1. 构建项目
110115
mvn clean package -DskipTests
@@ -134,7 +139,7 @@ mvn test -pl rpc-core,rpc-transport-netty
134139
运行完整的集成测试套件:
135140

136141
```bash
137-
mvn test -pl rpc-consumer -Dtest=FullIntegrationTest
142+
mvn test -pl rpc-consumer -am -Dtest=FullIntegrationTest
138143
```
139144

140145
### 5. 基准测试与性能结果
@@ -175,17 +180,22 @@ XiaoYu RPC 专注于极致性能。以下是使用 **JMH** 测得的真实数据
175180

176181
```yaml
177182
rpc:
178-
transport: "netty" # 传输层: netty (默认)
179-
protocol: "http2" # 协议: netty, http, http2
180-
server-host: 127.0.0.1
183+
transport: "netty" # 传输层: netty
184+
protocol: "netty" # 协议: netty, http, http2
185+
server-host: "127.0.0.1"
181186
server-port: 8080
182187
registry: "nacos" # 注册中心: nacos, local
183188
registry-address: "127.0.0.1:8848"
184-
serializer: KRYO # 序列化器: PROTOBUF, KRYO, JAVA, JSON
185-
proxy: bytebuddy # 代理方式: jdk, bytebuddy
189+
serializer: "protobuf" # 序列化器: protobuf, kryo, java, json
190+
proxy: "bytebuddy" # 代理方式: jdk, bytebuddy
186191
load-balancer: roundrobin # 负载均衡: roundrobin, random
192+
max-message-size: 8388608 # 8MB
187193
```
188194
195+
> [!IMPORTANT]
196+
> 若通过 `rpc-consumer` 的 `RpcClientProxy` 进行调用,请使用 `netty`/`http`/`http2` 协议。
197+
> `grpc` 仅建议用于与标准 grpc 客户端(Python/Go)互操作场景。
198+
189199
---
190200

191201
## ❓ 常见问题 (FAQ)
@@ -293,7 +303,7 @@ rpc:
293303
```
294304

295305
3. **运行 Python 客户端**:
296-
详情请参考 [python_client/client.py](file:///Users/yaoyao/Dev/JAVA_Dev_Project/gRPC/python_client/client.py)。
306+
详情请参考 [`python_client/client.py`](python_client/client.py)。
297307

298308
```bash
299309
cd python_client

‎rpc-core/src/main/resources/rpc-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
rpc:
2-
protocol: "grpc"
2+
protocol: "netty"
33
server-host: "127.0.0.1"
44
server-port: 8080
55
registry: "nacos"

0 commit comments

Comments
 (0)