cserwen commented on code in PR #6577:
URL: https://github.com/apache/rocketmq/pull/6577#discussion_r1163528087


##########
broker/src/main/java/org/apache/rocketmq/broker/processor/PopMessageProcessor.java:
##########
@@ -643,14 +643,41 @@ private CompletableFuture<Long> popMsgFromQueue(boolean 
isRetry, GetMessageResul
 
                 atomicRestNum.set(result.getMaxOffset() - 
result.getNextBeginOffset() + atomicRestNum.get());
                 String brokerName = 
brokerController.getBrokerConfig().getBrokerName();
-                for (SelectMappedBufferResult mapedBuffer : 
result.getMessageMapedList()) {
-                    // We should not recode buffer for normal topic message
-                    if (!isRetry) {
-                        getMessageResult.addMessage(mapedBuffer);
+                for (SelectMappedBufferResult mappedBuffer : 
result.getMessageMapedList()) {
+                    if (MixAll.isLmq(topic)) {
+                        List<MessageExt> messageExtList = 
MessageDecoder.decodesBatch(mappedBuffer.getByteBuffer(),
+                            true, false, true);
+                        mappedBuffer.release();
+                        for (MessageExt messageExt : messageExtList) {
+                            try {
+                                final Long queueOffset = 
result.getMessageQueueOffset().get(messageExtList.indexOf(messageExt));

Review Comment:
   Traversing the list with index can save the overhead of indexOf.



-- 
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