Skip to content
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

Closed
wants to merge 15 commits into from

Conversation

CLFutureX
Copy link
Contributor

Which Issue(s) This PR Fixes

Fixes #issue_id
issue

Brief Description

How Did You Test This Change?

@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2023

Codecov Report

Merging #7513 (a59631e) into develop (26fa050) will increase coverage by 0.01%.
The diff coverage is 39.13%.

@@              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     
Files Coverage Δ
...tmq/proxy/service/message/LocalMessageService.java 60.16% <100.00%> (-0.66%) ⬇️
...ocketmq/broker/processor/PullMessageProcessor.java 28.33% <50.00%> (ø)
.../rocketmq/client/impl/mqclient/MQClientAPIExt.java 0.00% <0.00%> (ø)
...g/apache/rocketmq/common/message/MessageBatch.java 75.86% <0.00%> (-5.62%) ⬇️
...q/proxy/service/message/ClusterMessageService.java 10.93% <0.00%> (-0.18%) ⬇️

... 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;
Copy link
Contributor

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(
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

判断条件变了一下,带来什么优化了吗

Copy link

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.

@github-actions github-actions bot added the stale label Nov 14, 2024
Copy link

This PR was closed because it has been inactive for 3 days since being marked as stale.

@github-actions github-actions bot closed this Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants