-
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
Closed
+49
−70
Closed
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cf28b9e
remove responseFuture when exception
CLFutureX ae1d6fa
Empty-Commit
CLFutureX b0e4027
Merge branch 'develop' into PiteChen_fix_7111
CLFutureX 8379354
Merge branch 'PiteChen_fix_7111' into develop
CLFutureX 8a14c2f
Merge branch 'apache:develop' into develop
CLFutureX 3c03c89
Merge branch 'apache:develop' into develop
CLFutureX bfbf575
Merge branch 'apache:develop' into develop
CLFutureX 3d734d6
code optimize
CLFutureX 216bc13
Merge branch 'apache:develop' into develop
CLFutureX 2990861
Merge branch 'apache:develop' into develop
CLFutureX a76f772
Merge branch 'develop' into PiteChen_fix_x6
CLFutureX 3dac0e2
sendMessage Optimize
CLFutureX 40805be
sendMessage Optimize
CLFutureX 2f1c310
sendMessage Optimize
CLFutureX a59631e
sendMessage Optimize
CLFutureX File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
sendMessage Optimize
commit 2f1c31092260aaedf2b97c291c095be4eb6b2209
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,12 +91,13 @@ public LocalMessageService(BrokerController brokerController, ChannelManager cha | |
public CompletableFuture<List<SendResult>> sendMessage(ProxyContext ctx, AddressableMessageQueue messageQueue, | ||
List<Message> msgList, SendMessageRequestHeader requestHeader, long timeoutMillis) { | ||
Message message; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 判断条件变了一下,带来什么优化了吗 |
||
if (requestHeader.isBatch()) { | ||
if (msgList.size() == 1) { | ||
message = msgList.get(0); | ||
} else { | ||
requestHeader.setBatch(true); | ||
message = MessageBatch.generateFromList(msgList); | ||
MessageClientIDSetter.setUniqID(message); | ||
((MessageBatch) message).fillBody(); | ||
} else { | ||
message = msgList.get(0); | ||
} | ||
RemotingCommand request = LocalRemotingCommand.createRequestCommand(RequestCode.SEND_MESSAGE, requestHeader, ctx.getLanguage()); | ||
request.setBody(message.getBody()); | ||
|
@@ -171,7 +172,8 @@ public CompletableFuture<RemotingCommand> sendMessageBack(ProxyContext ctx, Rece | |
} | ||
|
||
@Override | ||
public CompletableFuture<Void> endTransactionOneway(ProxyContext ctx, String brokerName, EndTransactionRequestHeader requestHeader, | ||
public CompletableFuture<Void> endTransactionOneway(ProxyContext ctx, String brokerName, | ||
EndTransactionRequestHeader requestHeader, | ||
long timeoutMillis) { | ||
CompletableFuture<Void> future = new CompletableFuture<>(); | ||
SimpleChannel channel = channelManager.createChannel(ctx); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
这个部分的改动似乎没有必要,原有的写法我觉得没什么问题