[ISSUE #10486] Add getMessageType(Map) overload to eliminate redundant properties decode#10487
Conversation
…dundant properties decode BrokerMetricsManager.getMessageType(SendMessageRequestHeader) is called once per send to classify the message. It internally decodes the properties String into a HashMap, but the typical caller (SendMessageProcessor) has already decoded the same String moments before. The result is a redundant decode allocation per send (one HashMap + ~14 String substrings + one Node[]). This commit adds a public overload getMessageType(Map<String, String>) that lets callers pass an already-decoded Map and reuse it. The existing SendMessageRequestHeader overload now delegates to the new overload; behavior is unchanged for callers that don't have a decoded Map. Downstream callers (e.g. SendMessageProcessor) can switch to the new overload in a separate broker-layer commit.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Refactors message-type detection to centralize logic based on parsed message properties, improving reuse and reducing duplication.
Changes:
- Changes
getMessageType(SendMessageRequestHeader)to delegate after parsing properties. - Introduces an overload
getMessageType(Map<String, String>)containing the core logic.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #10487 +/- ##
=============================================
- Coverage 48.06% 48.02% -0.05%
+ Complexity 13313 13300 -13
=============================================
Files 1377 1377
Lines 100632 100656 +24
Branches 12995 12996 +1
=============================================
- Hits 48369 48340 -29
- Misses 46344 46369 +25
- Partials 5919 5947 +28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10487 — Add getMessageType(Map) overload to eliminate redundant properties decode
Type: Performance (1 file, +4/-1)
Assessment
Eliminates redundant MessageDecoder.string2messageProperties() call in the send hot path. Adds a getMessageType(Map) overload so callers can pass the already-decoded properties map.
Verdict
✅ Clean, minimal change. Fixes #10486.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10487 — Add getMessageType(Map) overload to eliminate redundant properties decode
Type: Performance (1 file, +4/-1)
Assessment
Eliminates redundant MessageDecoder.string2messageProperties() call in the send hot path. Adds a getMessageType(Map) overload so callers can pass the already-decoded properties map.
Verdict
✅ Clean, minimal change. Fixes #10486.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10487 — Add getMessageType(Map) overload to eliminate redundant properties decode
Type: Performance (1 file, +4/-1)
Assessment
Eliminates redundant MessageDecoder.string2messageProperties() call in the send hot path. Adds a getMessageType(Map) overload so callers can pass the already-decoded properties map.
Verdict
✅ Clean, minimal change. Fixes #10486.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10487 — Add getMessageType(Map) overload to eliminate redundant properties decode
Type: Performance (1 file, +4/-1)
Assessment
Eliminates redundant MessageDecoder.string2messageProperties() call in the send hot path. Adds a getMessageType(Map) overload so callers can pass the already-decoded properties map.
Verdict
✅ Clean, minimal change. Fixes #10486.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10487 — Add getMessageType(Map) overload to eliminate redundant properties decode
Type: Performance (1 file, +4/-1)
Assessment
Eliminates redundant MessageDecoder.string2messageProperties() call in the send hot path. Adds a getMessageType(Map) overload so callers can pass the already-decoded properties map.
Verdict
✅ Clean, minimal change. Fixes #10486.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10487 — Add getMessageType(Map) overload to eliminate redundant properties decode
Type: Performance (1 file, +4/-1)
Assessment
Eliminates redundant MessageDecoder.string2messageProperties() call in the send hot path. Adds a getMessageType(Map) overload so callers can pass the already-decoded properties map.
Verdict
✅ Clean, minimal change. Fixes #10486.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10487 — Add getMessageType(Map) overload to eliminate redundant properties decode
Type: Performance (1 file, +4/-1)
Assessment
Eliminates redundant MessageDecoder.string2messageProperties() call in the send hot path. Adds a getMessageType(Map) overload so callers can pass the already-decoded properties map.
Verdict
✅ Clean, minimal change. Fixes #10486.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10487 — Add getMessageType(Map) overload to eliminate redundant properties decode
Type: Performance (1 file, +4/-1)
Assessment
Eliminates redundant MessageDecoder.string2messageProperties() call in the send hot path. Adds a getMessageType(Map) overload so callers can pass the already-decoded properties map.
Verdict
✅ Clean, minimal change. Fixes #10486.
🤖 Automated review by oss-sentinel-ai
Which Issue(s) This PR Fixes
Fixes #10486
Brief Description
BrokerMetricsManager.getMessageType(SendMessageRequestHeader)is called once per send to classify the message (NORMAL/TRANSACTION/DELAY/FIFO). It internally decodes the properties String into aHashMap, but the typical caller (SendMessageProcessor) has already decoded the same String moments before. The result is a redundant decode allocation per send (oneHashMap+ ~14Stringsubstrings + oneNode[]).This PR adds a public overload
getMessageType(Map<String, String>)that lets callers pass an already-decodedMapand reuse it. The existingSendMessageRequestHeaderoverload now delegates to the new overload; behavior is unchanged for callers that don't have a decodedMap.Downstream callers (e.g.
SendMessageProcessor) can switch to the new overload in a separate broker-layer commit.How Did You Test This Change?
BrokerMetricsManagerTest(27 tests) passes. The behavior of the original overload is preserved by delegation.Mapinstead of a freshly decoded one.Independence
This PR is independent of #10443 and #10481 — it doesn't reference any new constants and only restructures
BrokerMetricsManager.getMessageType(...)(1 file, +4/-1).