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 03:06:38 UTC

[GitHub] [incubator-eventmesh] jinrongluo opened a new pull request #593: [Issue #417] gRPC design doc and protobuf models

jinrongluo opened a new pull request #593:
URL: https://github.com/apache/incubator-eventmesh/pull/593


   Fixes ISSUE#417.
   
   ### Motivation
   
   - use gRPC protocol to support polyglot eventmesh client SDK
   
   
   ### Modifications
   
   - gRPC protocol design doc 
   -  gRPC protobuf model
   - gRPC protobuf code generation
   
   
   
   ### Documentation
   
   - Does this pull request introduce a new feature? yes
   - If yes, how is the feature documented? yes
   


-- 
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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
vongosling commented on pull request #593:
URL: https://github.com/apache/incubator-eventmesh/pull/593#issuecomment-969865883


   Very excited to see this initial shape, keep going...


-- 
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


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

Posted by GitBox <gi...@apache.org>.
jinrongluo commented on a change in pull request #593:
URL: https://github.com/apache/incubator-eventmesh/pull/593#discussion_r750505488



##########
File path: settings.gradle
##########
@@ -37,4 +37,5 @@ include 'eventmesh-protocol-plugin'
 include 'eventmesh-protocol-plugin:eventmesh-protocol-api'
 include 'eventmesh-protocol-plugin:eventmesh-protocol-openmessage'
 include 'eventmesh-protocol-plugin:eventmesh-protocol-cloudevents'
+include 'eventmesh-protocol-plugin:eventmesh-protocol-grpc'

Review comment:
       this module only contains grpc protobuf and the generated java codes. the actual implementation will be in runtime module and SDK module.
   
   For now grpc is in experimental development. Once it is mature and in good shape, it can replace TCP/HTTP transport in the runtime module, and SDK side. Thanks.




-- 
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


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

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on a change in pull request #593:
URL: https://github.com/apache/incubator-eventmesh/pull/593#discussion_r749902310



##########
File path: settings.gradle
##########
@@ -37,4 +37,5 @@ include 'eventmesh-protocol-plugin'
 include 'eventmesh-protocol-plugin:eventmesh-protocol-api'
 include 'eventmesh-protocol-plugin:eventmesh-protocol-openmessage'
 include 'eventmesh-protocol-plugin:eventmesh-protocol-cloudevents'
+include 'eventmesh-protocol-plugin:eventmesh-protocol-grpc'

Review comment:
       In my view, the grpc is used to replace `http` and `tcp`, it can help us easy to maintain rpc code and other language sdk. It can be placed in runtime module, if I am wrong, please correct me.




-- 
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


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

Posted by GitBox <gi...@apache.org>.
qqeasonchen commented on pull request #593:
URL: https://github.com/apache/incubator-eventmesh/pull/593#issuecomment-970081404


   > Very excited to see this initial shape, keep going...
   
   +1


-- 
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


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

Posted by GitBox <gi...@apache.org>.
qqeasonchen commented on a change in pull request #593:
URL: https://github.com/apache/incubator-eventmesh/pull/593#discussion_r750071593



##########
File path: settings.gradle
##########
@@ -37,4 +37,5 @@ include 'eventmesh-protocol-plugin'
 include 'eventmesh-protocol-plugin:eventmesh-protocol-api'
 include 'eventmesh-protocol-plugin:eventmesh-protocol-openmessage'
 include 'eventmesh-protocol-plugin:eventmesh-protocol-cloudevents'
+include 'eventmesh-protocol-plugin:eventmesh-protocol-grpc'

Review comment:
       yes, maybe it needs a "eventmesh-transport-plugin" which contains eventmesh-transport-grpc/eventmesh-transport-http/eventmesh-transport-tcp etc.




-- 
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


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

Posted by GitBox <gi...@apache.org>.
jinrongluo commented on a change in pull request #593:
URL: https://github.com/apache/incubator-eventmesh/pull/593#discussion_r750507338



##########
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:
       This is V1 version of protobuf and we are experimenting this grpc transport feature.
   
   Please  review and comment on this set of header attributes and improve it in V2. @qqeasonchen @ruanwenjun 
   
   Thanks.




-- 
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


[GitHub] [incubator-eventmesh] jinrongluo closed pull request #593: [Issue #417] gRPC design doc and protobuf models

Posted by GitBox <gi...@apache.org>.
jinrongluo closed pull request #593:
URL: https://github.com/apache/incubator-eventmesh/pull/593


   


-- 
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