You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by "hgaol (via GitHub)" <gi...@apache.org> on 2023/03/23 17:44:13 UTC

[GitHub] [incubator-eventmesh] hgaol opened a new pull request, #3524: [ISSUE #3523] fix json serialization issue when using redis

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

   <!--
   ### 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 `Closes #<XXX>`.)
   -->
   
   Fixes #3523 .
   
   ### Motivation
   
   bug fix for redis storage
   
   
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   
   
   ### Documentation
   
   - Does this pull request introduce a new feature? (yes / no)
   - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
   - If a feature is not applicable for documentation, explain why?
   - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


-- 
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] [eventmesh] mytang0 commented on a diff in pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "mytang0 (via GitHub)" <gi...@apache.org>.
mytang0 commented on code in PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524#discussion_r1149939475


##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/Constants.java:
##########
@@ -28,6 +28,8 @@ public class Constants {
 
     public static final String DATE_FORMAT_DEFAULT = "yyyy-MM-dd HH:mm:ss";
 
+    public static final String DATA_CONTENT_TYPE = "DataContentType";

Review Comment:
   <img width="534" alt="image" src="https://user-images.githubusercontent.com/29346818/228104739-6f6ec65a-4eff-428a-8bd6-18a1f1a5ac6c.png">
   
   The naming of protocol attributes can be unified.



-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] hgaol commented on a diff in pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "hgaol (via GitHub)" <gi...@apache.org>.
hgaol commented on code in PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524#discussion_r1149977775


##########
eventmesh-protocol-plugin/eventmesh-protocol-meshmessage/src/main/java/org/apache/eventmesh/protocol/meshmessage/resolver/tcp/TcpMessageProtocolResolver.java:
##########
@@ -77,7 +75,11 @@ public static CloudEvent buildEvent(Header header, EventMeshMessage message) thr
             .withSource(URI.create("/"))
             .withType("eventmeshmessage")
             .withSubject(topic)
-            .withData(content.getBytes(StandardCharsets.UTF_8));
+            .withData(content.getBytes(Constants.DEFAULT_CHARSET));
+
+        if (message.getHeaders().containsKey(Constants.DATA_CONTENT_TYPE)) {
+            cloudEventBuilder.withDataContentType(message.getHeaders().get(Constants.DATA_CONTENT_TYPE));
+        }
 

Review Comment:
   resolved. thanks for notification!



-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [incubator-eventmesh] mytang0 commented on pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "mytang0 (via GitHub)" <gi...@apache.org>.
mytang0 commented on PR #3524:
URL: https://github.com/apache/incubator-eventmesh/pull/3524#issuecomment-1484405222

   > > <img alt="image" width="429" src="https://user-images.githubusercontent.com/29346818/227404279-405baf37-1a17-45b0-b4cc-8fdfaff965a6.png">
   > > Please pass through the header, do not write hard.
   > 
   > Hi @mytang0 . Do you mean the Package header? I saw all of current headers are consistent for `EventMeshMessage`, see screenshot below. Or should I add another headers property with type `HashMap` in `EventMeshMessage`, and add all the headers in `Package.Header`? pls let me know your preference. Thanks! <img alt="image" width="812" src="https://user-images.githubusercontent.com/11908658/227476330-80387122-802d-4f33-a5fa-1cf4ef547209.png">
   
   Hello, that's what i thought
   
   - By default, dataContentType is 'application/json'. The problem with the test case is that the body is not json. So fixing 'text/plain' directly is problematic.
   - Therefore, to fundamentally solve this problem. The specified dataContentType that non-json needs to display when the producer publishes a message, and then pass the dataContentType on.


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [incubator-eventmesh] mxsm commented on a diff in pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm commented on code in PR #3524:
URL: https://github.com/apache/incubator-eventmesh/pull/3524#discussion_r1147101118


##########
eventmesh-protocol-plugin/eventmesh-protocol-meshmessage/src/main/java/org/apache/eventmesh/protocol/meshmessage/resolver/tcp/TcpMessageProtocolResolver.java:
##########
@@ -76,6 +76,7 @@ public static CloudEvent buildEvent(Header header, EventMeshMessage message) thr
             .withId(header.getSeq())
             .withSource(URI.create("/"))
             .withType("eventmeshmessage")
+            .withDataContentType("text/plain")
             .withSubject(topic)
             .withData(content.getBytes(StandardCharsets.UTF_8));

Review Comment:
   How about replace StandardCharsets.UTF_8 with Constants.DEFAULT_CHARSET, Consistent code style.
   .



-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] mytang0 merged pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "mytang0 (via GitHub)" <gi...@apache.org>.
mytang0 merged PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524


-- 
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] hgaol commented on a diff in pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "hgaol (via GitHub)" <gi...@apache.org>.
hgaol commented on code in PR #3524:
URL: https://github.com/apache/incubator-eventmesh/pull/3524#discussion_r1148817915


##########
eventmesh-protocol-plugin/eventmesh-protocol-meshmessage/src/main/java/org/apache/eventmesh/protocol/meshmessage/resolver/tcp/TcpMessageProtocolResolver.java:
##########
@@ -76,6 +76,7 @@ public static CloudEvent buildEvent(Header header, EventMeshMessage message) thr
             .withId(header.getSeq())
             .withSource(URI.create("/"))
             .withType("eventmeshmessage")
+            .withDataContentType("text/plain")
             .withSubject(topic)
             .withData(content.getBytes(StandardCharsets.UTF_8));

Review Comment:
   updated.



-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] hgaol commented on a diff in pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "hgaol (via GitHub)" <gi...@apache.org>.
hgaol commented on code in PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524#discussion_r1149977945


##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/Constants.java:
##########
@@ -28,6 +28,8 @@ public class Constants {
 
     public static final String DATE_FORMAT_DEFAULT = "yyyy-MM-dd HH:mm:ss";
 
+    public static final String DATA_CONTENT_TYPE = "DataContentType";

Review Comment:
   resolved.



-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] hgaol commented on pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "hgaol (via GitHub)" <gi...@apache.org>.
hgaol commented on PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524#issuecomment-1487010215

   I've created a new PR for fixing the CI issues, see #3544 .


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] hgaol commented on pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "hgaol (via GitHub)" <gi...@apache.org>.
hgaol commented on PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524#issuecomment-1487911345

   will rebase the newest master, thank you all!


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] xwm1992 commented on a diff in pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "xwm1992 (via GitHub)" <gi...@apache.org>.
xwm1992 commented on code in PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524#discussion_r1149950763


##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/Constants.java:
##########
@@ -28,6 +28,8 @@ public class Constants {
 
     public static final String DATE_FORMAT_DEFAULT = "yyyy-MM-dd HH:mm:ss";
 
+    public static final String DATA_CONTENT_TYPE = "DataContentType";

Review Comment:
   the DataContentType key in the CloudEvents protocol must be lowercase,please refer to https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md



-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] hgaol commented on pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "hgaol (via GitHub)" <gi...@apache.org>.
hgaol commented on PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524#issuecomment-1486067094

   Hi @mytang0 , any comment?


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] mytang0 commented on a diff in pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "mytang0 (via GitHub)" <gi...@apache.org>.
mytang0 commented on code in PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524#discussion_r1149939475


##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/Constants.java:
##########
@@ -28,6 +28,8 @@ public class Constants {
 
     public static final String DATE_FORMAT_DEFAULT = "yyyy-MM-dd HH:mm:ss";
 
+    public static final String DATA_CONTENT_TYPE = "DataContentType";

Review Comment:
   <img width="534" alt="image" src="https://user-images.githubusercontent.com/29346818/228104739-6f6ec65a-4eff-428a-8bd6-18a1f1a5ac6c.png">
   
   The naming of protocol attributes can be unified.



-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [incubator-eventmesh] codecov[bot] commented on pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #3524:
URL: https://github.com/apache/incubator-eventmesh/pull/3524#issuecomment-1481707384

   ## [Codecov](https://codecov.io/gh/apache/incubator-eventmesh/pull/3524?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 [#3524](https://codecov.io/gh/apache/incubator-eventmesh/pull/3524?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4fef922) into [master](https://codecov.io/gh/apache/incubator-eventmesh/commit/54cd00f38c7d15f015fbdfd156dcc44e0af89a9b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (54cd00f) will **decrease** coverage by `0.02%`.
   > The diff coverage is `33.33%`.
   
   > :exclamation: Current head 4fef922 differs from pull request most recent head 69addba. Consider uploading reports for the commit 69addba to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3524      +/-   ##
   ============================================
   - Coverage     14.62%   14.61%   -0.02%     
     Complexity     1526     1526              
   ============================================
     Files           651      651              
     Lines         31711    31705       -6     
     Branches       3033     3018      -15     
   ============================================
   - Hits           4638     4633       -5     
   - Misses        26657    26658       +1     
   + Partials        416      414       -2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-eventmesh/pull/3524?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ssage/resolver/tcp/TcpMessageProtocolResolver.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3524?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXByb3RvY29sLXBsdWdpbi9ldmVudG1lc2gtcHJvdG9jb2wtbWVzaG1lc3NhZ2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9wcm90b2NvbC9tZXNobWVzc2FnZS9yZXNvbHZlci90Y3AvVGNwTWVzc2FnZVByb3RvY29sUmVzb2x2ZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...me/core/protocol/grpc/service/ConsumerService.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3524?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2NvcmUvcHJvdG9jb2wvZ3JwYy9zZXJ2aWNlL0NvbnN1bWVyU2VydmljZS5qYXZh) | `0.00% <ø> (ø)` | |
   | [...e/core/protocol/grpc/service/HeartbeatService.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3524?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2NvcmUvcHJvdG9jb2wvZ3JwYy9zZXJ2aWNlL0hlYXJ0YmVhdFNlcnZpY2UuamF2YQ==) | `0.00% <ø> (ø)` | |
   | [...me/core/protocol/grpc/service/ProducerService.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3524?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2NvcmUvcHJvdG9jb2wvZ3JwYy9zZXJ2aWNlL1Byb2R1Y2VyU2VydmljZS5qYXZh) | `0.00% <ø> (ø)` | |
   | [...ventmesh/storage/rocketmq/admin/RocketMQAdmin.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3524?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXN0b3JhZ2UvZXZlbnRtZXNoLXN0b3JhZ2Utcm9ja2V0bXEvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9zdG9yYWdlL3JvY2tldG1xL2FkbWluL1JvY2tldE1RQWRtaW4uamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...h/storage/rocketmq/admin/RocketMQAdminAdaptor.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3524?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXN0b3JhZ2UvZXZlbnRtZXNoLXN0b3JhZ2Utcm9ja2V0bXEvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9zdG9yYWdlL3JvY2tldG1xL2FkbWluL1JvY2tldE1RQWRtaW5BZGFwdG9yLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...orage/standalone/admin/StandaloneAdminAdaptor.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3524?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXN0b3JhZ2UvZXZlbnRtZXNoLXN0b3JhZ2Utc3RhbmRhbG9uZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL3N0b3JhZ2Uvc3RhbmRhbG9uZS9hZG1pbi9TdGFuZGFsb25lQWRtaW5BZGFwdG9yLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...mesh/storage/standalone/admin/StandaloneAdmin.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3524?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXN0b3JhZ2UvZXZlbnRtZXNoLXN0b3JhZ2Utc3RhbmRhbG9uZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL3N0b3JhZ2Uvc3RhbmRhbG9uZS9hZG1pbi9TdGFuZGFsb25lQWRtaW4uamF2YQ==) | `92.30% <100.00%> (ø)` | |
   
   ... and [6 files with indirect coverage changes](https://codecov.io/gh/apache/incubator-eventmesh/pull/3524/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [incubator-eventmesh] hgaol commented on pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "hgaol (via GitHub)" <gi...@apache.org>.
hgaol commented on PR #3524:
URL: https://github.com/apache/incubator-eventmesh/pull/3524#issuecomment-1484556058

   > > > <img alt="image" width="429" src="https://user-images.githubusercontent.com/29346818/227404279-405baf37-1a17-45b0-b4cc-8fdfaff965a6.png">
   > > > Please pass through the header, do not write hard.
   > > 
   > > 
   > > Hi @mytang0 . Do you mean the Package header? I saw all of current headers are consistent for `EventMeshMessage`, see screenshot below. Or should I add another headers property with type `HashMap` in `EventMeshMessage`, and add all the headers in `Package.Header`? pls let me know your preference. Thanks! <img alt="image" width="812" src="https://user-images.githubusercontent.com/11908658/227476330-80387122-802d-4f33-a5fa-1cf4ef547209.png">
   > 
   > Hello, that's what i thought
   > 
   > * By default, dataContentType is 'application/json'. The problem with the test case is that the body is not json. So fixing 'text/plain' directly is problematic.
   > * Therefore, to fundamentally solve this problem. The specified dataContentType that non-json needs to display when the producer publishes a message, and then pass the dataContentType on.
   > * You are right to think about it. We can be simple first, directly in the header.properties
   
   updated. pls let me know if any comment. :)


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] mytang0 commented on a diff in pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "mytang0 (via GitHub)" <gi...@apache.org>.
mytang0 commented on code in PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524#discussion_r1149955370


##########
eventmesh-protocol-plugin/eventmesh-protocol-meshmessage/src/main/java/org/apache/eventmesh/protocol/meshmessage/resolver/tcp/TcpMessageProtocolResolver.java:
##########
@@ -77,7 +75,11 @@ public static CloudEvent buildEvent(Header header, EventMeshMessage message) thr
             .withSource(URI.create("/"))
             .withType("eventmeshmessage")
             .withSubject(topic)
-            .withData(content.getBytes(StandardCharsets.UTF_8));
+            .withData(content.getBytes(Constants.DEFAULT_CHARSET));
+
+        if (message.getHeaders().containsKey(Constants.DATA_CONTENT_TYPE)) {
+            cloudEventBuilder.withDataContentType(message.getHeaders().get(Constants.DATA_CONTENT_TYPE));
+        }
 

Review Comment:
   Since you implement by adding headers, you also need to set headers in TcpMessageProtocolResolver#buildEventMeshMessage.
   
   ```
   if (cloudEvent.getDataContentType() != null) {
              eventMeshMessage.getHeaders().put(Constants.DATA_CONTENT_TYPE, cloudEvent.getDataContentType());
   }
   ```



-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] hgaol commented on pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "hgaol (via GitHub)" <gi...@apache.org>.
hgaol commented on PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524#issuecomment-1486850560

   > > don't know why CI still error, I didn't change this class and it's succeeded to build on my local machine... <img alt="image" width="1122" src="https://user-images.githubusercontent.com/11908658/228134038-aed3376a-3401-417b-bf3e-48682787755d.png">
   > 
   > you can find this under the `HTTPClientHandler` , because using try-catch with resource, you can remove the `out.write` in the catch block with the `log.error` instead.
   
   seems the github action will link this PR branch to another one, maybe the master branch. In my branch for the PR, the `HTTPClientHandler` is different. You can find the code below.
   
   I didn't use the `checkout` github action for long time, and will find some time to learn if it's by design...
   
   https://github.com/hgaol/incubator-eventmesh/blob/3523/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/HTTPClientHandler.java#L98


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] xwm1992 commented on pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "xwm1992 (via GitHub)" <gi...@apache.org>.
xwm1992 commented on PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524#issuecomment-1486564994

   > don't know why CI still error, I didn't change this class and it's succeeded to build on my local machine... <img alt="image" width="1122" src="https://user-images.githubusercontent.com/11908658/228134038-aed3376a-3401-417b-bf3e-48682787755d.png">
   
   you can find this under the `HTTPClientHandler` , because using try-catch with resource, you can remove the `out.write` in the catch block with the `log.error` instead.


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] mytang0 commented on pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "mytang0 (via GitHub)" <gi...@apache.org>.
mytang0 commented on PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524#issuecomment-1487909086

   > I've created a new PR for fixing the CI issues, see #3544 .
   
   Already merged, please merge into your branch.


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [incubator-eventmesh] hgaol commented on pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "hgaol (via GitHub)" <gi...@apache.org>.
hgaol commented on PR #3524:
URL: https://github.com/apache/incubator-eventmesh/pull/3524#issuecomment-1482486419

   > <img alt="image" width="429" src="https://user-images.githubusercontent.com/29346818/227404279-405baf37-1a17-45b0-b4cc-8fdfaff965a6.png">
   > 
   > Please pass through the header, do not write hard.
   
   do you mean the Package header? I saw all of current headers are consistent for `EventMeshMessage`, see screenshot below. Or should I add another headers property with type `HashMap` in `EventMeshMessage`, and add all the headers in `Package.Header`?
   pls let me know your preference. Thanks!
   <img width="812" alt="image" src="https://user-images.githubusercontent.com/11908658/227476330-80387122-802d-4f33-a5fa-1cf4ef547209.png">
   


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [incubator-eventmesh] hgaol commented on a diff in pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "hgaol (via GitHub)" <gi...@apache.org>.
hgaol commented on code in PR #3524:
URL: https://github.com/apache/incubator-eventmesh/pull/3524#discussion_r1147304316


##########
eventmesh-protocol-plugin/eventmesh-protocol-meshmessage/src/main/java/org/apache/eventmesh/protocol/meshmessage/resolver/tcp/TcpMessageProtocolResolver.java:
##########
@@ -76,6 +76,7 @@ public static CloudEvent buildEvent(Header header, EventMeshMessage message) thr
             .withId(header.getSeq())
             .withSource(URI.create("/"))
             .withType("eventmeshmessage")
+            .withDataContentType("text/plain")
             .withSubject(topic)
             .withData(content.getBytes(StandardCharsets.UTF_8));

Review Comment:
   will do. thanks for your advice.



-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [incubator-eventmesh] mxsm commented on a diff in pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm commented on code in PR #3524:
URL: https://github.com/apache/incubator-eventmesh/pull/3524#discussion_r1147101118


##########
eventmesh-protocol-plugin/eventmesh-protocol-meshmessage/src/main/java/org/apache/eventmesh/protocol/meshmessage/resolver/tcp/TcpMessageProtocolResolver.java:
##########
@@ -76,6 +76,7 @@ public static CloudEvent buildEvent(Header header, EventMeshMessage message) thr
             .withId(header.getSeq())
             .withSource(URI.create("/"))
             .withType("eventmeshmessage")
+            .withDataContentType("text/plain")
             .withSubject(topic)
             .withData(content.getBytes(StandardCharsets.UTF_8));

Review Comment:
   How about replace StandardCharsets.UTF_8 with Constants.DEFAULT_CHARSET, Consistent code style.



-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] hgaol commented on pull request #3524: [ISSUE #3523] fix json serialization issue when using redis

Posted by "hgaol (via GitHub)" <gi...@apache.org>.
hgaol commented on PR #3524:
URL: https://github.com/apache/eventmesh/pull/3524#issuecomment-1486224565

   don't know why CI still error, I didn't change this class and it's succeeded to build on my local machine...
   <img width="1122" alt="image" src="https://user-images.githubusercontent.com/11908658/228134038-aed3376a-3401-417b-bf3e-48682787755d.png">
   


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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