Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion store/src/main/java/org/apache/rocketmq/store/CommitLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,18 @@ public DispatchRequest checkMessageAndReturnSize(java.nio.ByteBuffer byteBuffer,
return new DispatchRequest(-1, false/* success */);
}
} else {
// Read full message for logging when error occurs
ByteBuffer fullMessageBuffer = byteBuffer.duplicate();
int messageStartPos = fullMessageBuffer.position() - totalSize;
fullMessageBuffer.position(messageStartPos);
fullMessageBuffer.limit(messageStartPos + totalSize);
byte[] fullMessageBytes = new byte[totalSize];
fullMessageBuffer.get(fullMessageBytes, 0, totalSize);

// Print full message and especially properties
log.warn(
"CommitLog#checkAndDispatchMessage: failed to check message CRC, not found CRC in properties");
"CommitLog#checkAndDispatchMessage: failed to check message CRC, not found CRC in properties. topic={}, properties={}, propertiesLength={}, fullMessageHex={}",
topic, propertiesMap != null ? propertiesMap.toString() : "null", propertiesLength, UtilAll.bytes2string(fullMessageBytes));
return new DispatchRequest(-1, false/* success */);
}
}
Expand Down
Loading