You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2021/11/16 05:17:57 UTC

[GitHub] [incubator-eventmesh] vongosling commented on a change in pull request #593: [Issue #417] gRPC design doc and protobuf models

vongosling commented on a change in pull request #593:
URL: https://github.com/apache/incubator-eventmesh/pull/593#discussion_r749905185



##########
File path: docs/cn/instructions/eventmesh-runtime-protocol.md
##########
@@ -258,3 +258,123 @@ public class LiteMessage {
 | 场景               | Server向Client发送消息请求码 | Client回复Server消息响应码 | 说明                   |
 | ------------------ | ---------------------------- | -------------------------- | ---------------------- |
 | 客户端接收异步事件 | HTTP_PUSH_CLIENT_ASYNC(105)  | retCode                    | retCode值为0时代表成功 |
+
+
+## gRPC 协议文档
+
+#### 1. protobuf
+
+在 `eventmesh-protocol-gprc` 模块有 Eventmesh gRPC 客户端的 protobuf 文件. the protobuf 文件路径是 `/src/main/proto/eventmesh-client.proto`.
+
+用gradle build 生成 gRPC 代码在 `/build/generated/source/proto/main`. 生成代码用于 `eventmesh-sdk-java` 模块.
+
+#### 2. gRPC 数据模型
+
+- 消息
+
+以下消息数据模型用于 `publish()`, `requestReply()` 和 `broadcast()` APIs.
+
+```
+message RequestHeader {
+    string env = 1;
+    string region = 2;
+    string idc = 3;

Review comment:
       BTW, any guys want to add comment for every field in protocol?

##########
File path: eventmesh-connector-plugin/eventmesh-protocol-grpc/build.gradle
##########
@@ -0,0 +1,48 @@
+plugins {
+    id 'java'
+    id 'com.google.protobuf' version '0.8.17'
+}
+
+group 'org.apache.eventmesh'
+version '1.3.0-SNAPSHOT'
+
+repositories {
+    mavenCentral()
+}
+
+def grpcVersion = '1.15.0' // CURRENT_GRPC_VERSION
+def protobufVersion = '3.5.1'
+def reactiveGrpcVersion = '1.2.3'
+def protocVersion = protobufVersion
+
+dependencies {
+    implementation "io.grpc:grpc-protobuf:${grpcVersion}"
+    implementation "io.grpc:grpc-stub:${grpcVersion}"
+    implementation "com.google.protobuf:protobuf-java-util:${protobufVersion}"
+    implementation "io.reactivex.rxjava2:rxjava:2.2.21"

Review comment:
       reactive maybe an optional dependency, right?

##########
File path: docs/cn/instructions/eventmesh-runtime-protocol.md
##########
@@ -258,3 +258,123 @@ public class LiteMessage {
 | 场景               | Server向Client发送消息请求码 | Client回复Server消息响应码 | 说明                   |
 | ------------------ | ---------------------------- | -------------------------- | ---------------------- |
 | 客户端接收异步事件 | HTTP_PUSH_CLIENT_ASYNC(105)  | retCode                    | retCode值为0时代表成功 |
+
+
+## gRPC 协议文档
+
+#### 1. protobuf
+
+在 `eventmesh-protocol-gprc` 模块有 Eventmesh gRPC 客户端的 protobuf 文件. the protobuf 文件路径是 `/src/main/proto/eventmesh-client.proto`.
+
+用gradle build 生成 gRPC 代码在 `/build/generated/source/proto/main`. 生成代码用于 `eventmesh-sdk-java` 模块.
+
+#### 2. gRPC 数据模型
+
+- 消息
+
+以下消息数据模型用于 `publish()`, `requestReply()` 和 `broadcast()` APIs.
+
+```
+message RequestHeader {
+    string env = 1;
+    string region = 2;
+    string idc = 3;

Review comment:
       region, namespace, idc, rack and so on. these tenant or geographic info should be carefully designed in our v2 version.

##########
File path: eventmesh-connector-plugin/eventmesh-protocol-grpc/src/main/proto/addressbook.proto
##########
@@ -0,0 +1,40 @@
+syntax = "proto3";
+

Review comment:
       Should be refactoring to another example package or remove it directly




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org