wang-jiahua commented on code in PR #10981:
URL: https://github.com/apache/rocketmq/pull/10981#discussion_r3877219862


##########
store/src/test/java/org/apache/rocketmq/store/pop/BatchAckMsgTest.java:
##########
@@ -21,6 +21,7 @@
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;

Review Comment:
   Reordered the imports (com / java / org groups) in this test (commit 
f2696b9).



##########
broker/src/main/java/org/apache/rocketmq/broker/processor/PopReviveService.java:
##########
@@ -385,11 +385,10 @@ protected void consumeReviveMessage(ConsumeReviveObj 
consumeReviveObj) {
             }
             for (MessageExt messageExt : messageExts) {
                 if (PopAckConstants.CK_TAG.equals(messageExt.getTags())) {
-                    String raw = new String(messageExt.getBody(), 
DataConverter.CHARSET_UTF8);
                     if (brokerController.getBrokerConfig().isEnablePopLog()) {

Review Comment:
   Added an `isInfoEnabled()` guard next to the config check at all three 
sites, so the raw string is only materialized when it can actually be logged 
(commit f2696b9).



##########
broker/src/main/java/org/apache/rocketmq/broker/processor/PopReviveService.java:
##########
@@ -400,11 +399,10 @@ protected void consumeReviveMessage(ConsumeReviveObj 
consumeReviveObj) {
                         firstRt = point.getReviveTime();
                     }
                 } else if 
(PopAckConstants.ACK_TAG.equals(messageExt.getTags())) {
-                    String raw = new String(messageExt.getBody(), 
StandardCharsets.UTF_8);
                     if (brokerController.getBrokerConfig().isEnablePopLog()) {
-                        POP_LOGGER.info("reviveQueueId={}, find ack, 
offset:{}, raw : {}", messageExt.getQueueId(), messageExt.getQueueOffset(), 
raw);
+                        POP_LOGGER.info("reviveQueueId={}, find ack, 
offset:{}, raw : {}", messageExt.getQueueId(), messageExt.getQueueOffset(), new 
String(messageExt.getBody(), StandardCharsets.UTF_8));

Review Comment:
   Same fix as above — guarded with `isInfoEnabled()` (commit f2696b9).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to