-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #7512] Simplify message sending at the basic layer and reduce redundant judgments #7513
Conversation
# Conflicts: # client/src/main/java/org/apache/rocketmq/client/impl/mqclient/MQClientAPIExt.java # proxy/src/main/java/org/apache/rocketmq/proxy/service/message/LocalMessageService.java
Codecov Report
@@ Coverage Diff @@
## develop #7513 +/- ##
=============================================
+ Coverage 42.98% 43.00% +0.01%
- Complexity 9674 9682 +8
=============================================
Files 1158 1158
Lines 83982 83963 -19
Branches 10916 10917 +1
=============================================
+ Hits 36102 36110 +8
+ Misses 43380 43359 -21
+ Partials 4500 4494 -6
... and 15 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -152,7 +150,9 @@ public CompletableFuture<SendResult> sendMessageAsync( | |||
long timeoutMillis | |||
) { | |||
SendMessageRequestHeaderV2 requestHeaderV2 = SendMessageRequestHeaderV2.createSendMessageRequestHeaderV2(requestHeader); | |||
RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.SEND_MESSAGE_V2, requestHeaderV2); | |||
|
|||
int code = requestHeader.isBatch() ? RequestCode.SEND_BATCH_MESSAGE : RequestCode.SEND_MESSAGE_V2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code使用RequestCode类型,可读性会更好
} | ||
future = this.mqClientAPIFactory.getClient().sendMessageAsync( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个部分的改动似乎没有必要,原有的写法我觉得没什么问题
body = msgBatch.encode(); | ||
msgBatch.setBody(body); | ||
messageId = MessageClientIDSetter.getUniqID(msgBatch); | ||
Message message; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
判断条件变了一下,带来什么优化了吗
This PR is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR. |
This PR was closed because it has been inactive for 3 days since being marked as stale. |
Which Issue(s) This PR Fixes
Fixes #issue_id
issue
Brief Description
How Did You Test This Change?