Avoid logging raw heartbeat sync message body
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in proxy/src/main/java/org/apache/rocketmq/proxy/service/sysmessage/HeartbeatSyncer.java at HeartbeatSyncer.consumeMessage and inspect the failure logging path. Add targeted coverage for the summary helper, ensuring failures retain useful diagnostics without emitting raw heartbeat payload fields; heartbeat sync behavior should remain unchanged.
Written by the indexing model from the issue text.
Description
Problem
HeartbeatSyncer.consumeMessage logs the full MessageExt and raw message body when heartbeat sync message parsing or processing fails:
log.error("heartbeat consume message failed. msg:{}, data:{}", msg, new String(msg.getBody(), StandardCharsets.UTF_8), t);
The body contains serialized heartbeat synchronization data, including client identity and subscription metadata. Logging the raw body is unnecessary for diagnostics and can expose operational metadata in proxy logs.
Scope
Track 2 / Proxy runtime diagnostics hardening. This is a logging-safety change only; heartbeat sync behavior should remain unchanged.
Expected behavior
- Do not log raw heartbeat sync message body on failure.
- Keep useful diagnostics such as topic, messageId, body size, and parsed heartbeat summary when available.
- Add targeted coverage for the summary helper so raw payload fields are not emitted.
Evidence
proxy/src/main/java/org/apache/rocketmq/proxy/service/sysmessage/HeartbeatSyncer.javalogsnew String(msg.getBody(), StandardCharsets.UTF_8)in the catch block.
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/rocketmq
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
[Bug] TopicValidator rejects V2 retry topic names containing `+` separator introduced by KeyBuilder Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100