You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "lizhanhui (via GitHub)" <gi...@apache.org> on 2023/04/12 10:30:51 UTC
[GitHub] [rocketmq] lizhanhui commented on a diff in pull request #6580: [ISSUE #6579] Prevent the properties of trace message from exceeding the maximum value of short
lizhanhui commented on code in PR #6580:
URL: https://github.com/apache/rocketmq/pull/6580#discussion_r1163942696
##########
client/src/main/java/org/apache/rocketmq/client/trace/AsyncTraceDispatcher.java:
##########
@@ -328,13 +330,12 @@ public void addTraceTransferBean(TraceTransferBean traceTransferBean) {
initFirstBeanAddTime();
this.traceTransferBeanList.add(traceTransferBean);
this.currentMsgSize += traceTransferBean.getTransData().length();
- if (currentMsgSize >= traceProducer.getMaxMessageSize() - 10 * 1000) {
+ traceTransferBean.getTransKey().forEach(x -> this.currentMsgKeySize += x.length());
Review Comment:
[reduce](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#reduce-T-java.util.function.BinaryOperator-), IMO, is a better fit here.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org