Skip to content

Conversation

@mxsm
Copy link
Member

@mxsm mxsm commented Dec 8, 2023

Fixes #4631

Motivation

Explain the content here.
Explain why you want to make the changes and what problem you're trying to solve.

  • Optimize the message body of the Java SDK's returned reply message

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

@codecov
Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (ee9ee4c) 16.93% compared to head (30b860d) 16.94%.

Files Patch % Lines
...entmesh/client/grpc/consumer/SubStreamHandler.java 0.00% 3 Missing ⚠️
...me/core/protocol/grpc/service/ConsumerService.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #4632   +/-   ##
=========================================
  Coverage     16.93%   16.94%           
+ Complexity     1708     1707    -1     
=========================================
  Files           790      789    -1     
  Lines         29526    29498   -28     
  Branches       2550     2550           
=========================================
- Hits           5001     4999    -2     
+ Misses        24061    24034   -27     
- Partials        464      465    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

subscriptionReply.putAllProperties(prop);

return CloudEvent.newBuilder(cloudEvent).putAllAttributes(reqMessageMap)
return CloudEvent.newBuilder(cloudEvent).putAllAttributes(reqMessageMap).putAllAttributes(cloudEventMap)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't newBuilder(cloudEvent) automatically merge the attributes (i.e., cloudEventMap) of cloudEvent here? Additionally, is prop object redundant now?

newBuilder(cloudEvent)这一步不是会自动合并cloudEvent的attributes(即cloudEventMap)吗?另外prop对象现在是不是多余的?

Copy link
Member Author

@mxsm mxsm Dec 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't newBuilder(cloudEvent) automatically merge the attributes (i.e., cloudEventMap) of cloudEvent here? Additionally, is prop object redundant now?

newBuilder(cloudEvent)这一步不是会自动合并cloudEvent的attributes(即cloudEventMap)吗?另外prop对象现在是不是多余的?

@pandaapo Here, it is guaranteed that if there are identical properties between the returned message and the consumed message, the properties of the consumed message will be used. At the same time, I compared the version before optimization. It is also a similar operation. If the properties do not need to be overwritten, this step is not required. I keep it consistent with the version before GRPC optimization.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there are identical properties between the returned message and the consumed message, the properties of the consumed message will be used.

OK. Then what is role of prop?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there are identical properties between the returned message and the consumed message, the properties of the consumed message will be used.

OK. Then what is role of prop?

@pandaapo I have removed it. my fault .

@mxsm mxsm requested a review from pandaapo December 9, 2023 13:42
@xwm1992 xwm1992 merged commit 24873dd into apache:master Dec 10, 2023
@mxsm mxsm deleted the eventmesh-4631 branch December 12, 2023 01:04
xuhongjia pushed a commit to Deckers-Ohana/eventmesh that referenced this pull request Mar 13, 2025
…ed reply message (apache#4632)

* [ISSUE apache#4631]Optimize the message body of the SDK's returned reply message

* optimize code, remove useless code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Optimize the message body of the Java SDK's returned reply message

3 participants