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 2022/08/14 09:09:29 UTC

[GitHub] [incubator-eventmesh] RiESAEX opened a new pull request, #1156: [ISSUE #815] feat: Rust sdk

RiESAEX opened a new pull request, #1156:
URL: https://github.com/apache/incubator-eventmesh/pull/1156

   <!--
   ### Contribution Checklist
   
     - Name the pull request in the form "[ISSUE #XXXX] Title of the pull request", 
       where *XXXX* should be replaced by the actual issue number.
       Skip *[ISSUE #XXXX]* if there is no associated github issue for this pull request.
   
     - Fill out the template below to describe the changes contributed by the pull request. 
       That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue. 
       Please do not mix up code from multiple issues.
     
     - Each commit in the pull request should have a meaningful commit message.
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, 
       leaving only the filled out template below.
   
   (The sections below can be removed for hotfixes of typos)
   -->
   
   <!--
   (If this PR fixes a GitHub issue, please add `Fixes #<XXX>` or `Cloese #<XXX>`.)
   -->
   
   Resolve #815 
   ### Motivation
   this PR is create to reduce potential duplicate work of rust sdk
   
   ### Modifications
   eventmesh-sdk-rust/
   
   ### Jobs
   - [x] grpc producer publish
   - [ ] grpc producer batch publish
   - [ ] grpc producer request
   - [ ] grpc consumer
   
   - [x] http producer publish
   - [ ] http producer request
   - [ ] http consumer
   
   - [ ] load balance
   - [ ] doc, test and example


-- 
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 #1156: [ISSUE #815] feature: Rust sdk

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

   @RiESAEX please take care of the CI fail tasks.


-- 
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] Alonexc commented on a diff in pull request #1156: [ISSUE #815] feat: Rust sdk

Posted by GitBox <gi...@apache.org>.
Alonexc commented on code in PR #1156:
URL: https://github.com/apache/incubator-eventmesh/pull/1156#discussion_r946278734


##########
eventmesh-sdk-rust/eventmesh/src/message.rs:
##########
@@ -0,0 +1,38 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct EventMeshMessage {
+    #[serde(rename = "bizseqno")]
+    pub biz_seq_no: String,
+    #[serde(rename = "uniqueid")]
+    pub unique_id: String,
+    pub topic: String,
+    pub content: String,
+    // pub prop: HashMap<String, String>,
+    pub ttl: i32,
+    // pub(crate) create_time: u64,
+}
+impl EventMeshMessage {
+    pub fn new(biz_seq_no: &str, unique_id: &str, topic: &str, content: &str, ttl: i32) -> Self {
+        Self {
+            biz_seq_no: biz_seq_no.to_string(),
+            unique_id: unique_id.to_string(),
+            topic: topic.to_string(),
+            content: content.to_string(),
+            ttl,

Review Comment:
   Ok, I see, you don't seem to have added a license, maybe you need to add it.



-- 
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] codecov[bot] commented on pull request #1156: [ISSUE #815] feat: Rust sdk

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #1156:
URL: https://github.com/apache/incubator-eventmesh/pull/1156#issuecomment-1225376690

   # [Codecov](https://codecov.io/gh/apache/incubator-eventmesh/pull/1156?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1156](https://codecov.io/gh/apache/incubator-eventmesh/pull/1156?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8b2f3fd) into [master](https://codecov.io/gh/apache/incubator-eventmesh/commit/8b2f3fd38051fa85fe0f48421eb12e4d03205b42?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8b2f3fd) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 8b2f3fd differs from pull request most recent head c970282. Consider uploading reports for the commit c970282 to get more accurate results
   
   ```diff
   @@           Coverage Diff            @@
   ##             master   #1156   +/-   ##
   ========================================
     Coverage      9.99%   9.99%           
     Complexity      644     644           
   ========================================
     Files           382     382           
     Lines         23640   23640           
     Branches       2619    2619           
   ========================================
     Hits           2362    2362           
     Misses        21057   21057           
     Partials        221     221           
   ```
   
   
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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 #1156: [ISSUE #815] feat: Rust sdk

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

   @RiESAEX Nice job, I suggest you submit by servral smaller PRs, thx.


-- 
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 merged pull request #1156: [ISSUE #815] feature: Rust sdk

Posted by GitBox <gi...@apache.org>.
qqeasonchen merged PR #1156:
URL: https://github.com/apache/incubator-eventmesh/pull/1156


-- 
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] Alonexc commented on a diff in pull request #1156: [ISSUE #815] feat: Rust sdk

Posted by GitBox <gi...@apache.org>.
Alonexc commented on code in PR #1156:
URL: https://github.com/apache/incubator-eventmesh/pull/1156#discussion_r945509733


##########
eventmesh-sdk-rust/eventmesh/src/message.rs:
##########
@@ -0,0 +1,38 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct EventMeshMessage {
+    #[serde(rename = "bizseqno")]
+    pub biz_seq_no: String,
+    #[serde(rename = "uniqueid")]
+    pub unique_id: String,
+    pub topic: String,
+    pub content: String,
+    // pub prop: HashMap<String, String>,
+    pub ttl: i32,
+    // pub(crate) create_time: u64,
+}
+impl EventMeshMessage {
+    pub fn new(biz_seq_no: &str, unique_id: &str, topic: &str, content: &str, ttl: i32) -> Self {
+        Self {
+            biz_seq_no: biz_seq_no.to_string(),
+            unique_id: unique_id.to_string(),
+            topic: topic.to_string(),
+            content: content.to_string(),
+            ttl,

Review Comment:
   If the code is not used subsequently, it may be possible to remove the commented out code.



-- 
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 #1156: [ISSUE #815] feat: Rust sdk

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

   @RiESAEX I suggest submitting by several smaller PRs.


-- 
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] RiESAEX commented on a diff in pull request #1156: [ISSUE #815] feat: Rust sdk

Posted by GitBox <gi...@apache.org>.
RiESAEX commented on code in PR #1156:
URL: https://github.com/apache/incubator-eventmesh/pull/1156#discussion_r945677804


##########
eventmesh-sdk-rust/eventmesh/src/message.rs:
##########
@@ -0,0 +1,38 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct EventMeshMessage {
+    #[serde(rename = "bizseqno")]
+    pub biz_seq_no: String,
+    #[serde(rename = "uniqueid")]
+    pub unique_id: String,
+    pub topic: String,
+    pub content: String,
+    // pub prop: HashMap<String, String>,
+    pub ttl: i32,
+    // pub(crate) create_time: u64,
+}
+impl EventMeshMessage {
+    pub fn new(biz_seq_no: &str, unique_id: &str, topic: &str, content: &str, ttl: i32) -> Self {
+        Self {
+            biz_seq_no: biz_seq_no.to_string(),
+            unique_id: unique_id.to_string(),
+            topic: topic.to_string(),
+            content: content.to_string(),
+            ttl,

Review Comment:
   for `create_time`
   https://github.com/apache/incubator-eventmesh/blob/8b2f3fd38051fa85fe0f48421eb12e4d03205b42/eventmesh-common/src/main/java/org/apache/eventmesh/common/EventMeshMessage.java#L44
   there is a field in java code, but it was not used (may be used in logger?). I'm not sure if it's needed so I just commented it.
   
   for ths `prop`, I just not sure what it is.
   I found it only store the `TTL` (except test code of EventMeshMessage).
    https://github.com/apache/incubator-eventmesh/blob/8b2f3fd38051fa85fe0f48421eb12e4d03205b42/eventmesh-protocol-plugin/eventmesh-protocol-grpc/src/main/proto/eventmesh-client.proto#L46-L50
   In grpc producer, the `message` already has a `TTL` field and `prop` is sent,
   https://github.com/apache/incubator-eventmesh/blob/8b2f3fd38051fa85fe0f48421eb12e4d03205b42/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/producer/EventMeshMessageProducer.java#L138
   In http producer, I think the `prop`  was not even send (It just pick up the ttl in it, and put it to header).
   



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