This is an automated email from the ASF dual-hosted git repository.
jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new c7892a694a [ISSUE #9852] Print full message when CRC not found in
properties (#9853)
c7892a694a is described below
commit c7892a694a2d2c4d920a54e12f217204b17eb682
Author: guyinyou <[email protected]>
AuthorDate: Mon Jan 26 10:02:17 2026 +0800
[ISSUE #9852] Print full message when CRC not found in properties (#9853)
When the error 'failed to check message CRC, not found CRC in properties'
occurs,
now it will print the full message content including topic, properties map,
properties length, and full message hex for debugging purposes.
Change-Id: I26d977e13802c5e69d01f16512e40d121dcff354
Co-developed-by: Cursor <[email protected]>
Co-authored-by: guyinyou <[email protected]>
---
store/src/main/java/org/apache/rocketmq/store/CommitLog.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java
b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java
index 01d0739d15..078d484c6f 100644
--- a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java
+++ b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java
@@ -623,8 +623,18 @@ public class CommitLog implements Swappable {
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 */);
}
}