RongtongJin commented on a change in pull request #2343:
URL: https://github.com/apache/rocketmq/pull/2343#discussion_r502852616



##########
File path: store/src/main/java/org/apache/rocketmq/store/CommitLog.java
##########
@@ -1871,9 +1878,13 @@ public ByteBuffer encode(final MessageExtBatch 
messageExtBatch) {
                 this.msgBatchMemory.put((byte) topicLength);
                 this.msgBatchMemory.put(topicData);
                 // 17 PROPERTIES
-                this.msgBatchMemory.putShort(propertiesLen);
-                if (propertiesLen > 0)
+                this.msgBatchMemory.putShort((short) (propertiesLen + 
batchPropLen));
+                if (propertiesLen > 0) {
                     this.msgBatchMemory.put(messagesByteBuff.array(), 
propertiesPos, propertiesLen);
+                }
+                if (batchPropLen > 0) {
+                    this.msgBatchMemory.put(batchPropData, 0, batchPropLen);
+                }

Review comment:
       Just put properties of MessageExtBatch into msgBatchMemory. The original 
code takes the properties of a single message, so it does not exist.




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

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


Reply via email to