You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "wang-jiahua (via GitHub)" <gi...@apache.org> on 2026/06/21 01:49:10 UTC

[I] [Enhancement] Implement FastCodesHeader encode/decode for SendMessageRequestHeader/ResponseHeader [rocketmq]

wang-jiahua opened a new issue, #10533:
URL: https://github.com/apache/rocketmq/issues/10533

   ### Before Creating the Enhancement Request
   
   - [x] I have confirmed that this should be classified as an enhancement rather than a bug/feature.
   
   ### Summary
   
   Implement `FastCodesHeader.encode()/decode()` for `SendMessageRequestHeader` and `SendMessageResponseHeader` to eliminate reflection-based header serialization.
   
   ### Motivation
   
   `SendMessageRequestHeader` does not implement `FastCodesHeader`, so every send message request goes through `makeCustomHeaderToNet()` which uses reflection to serialize header fields into `extFields`. This creates per-RPC allocation (HashMap entries, String values from `toString()`) and CPU overhead from reflective field access.
   
   With R1 (#10522) merged, the `FastCodesHeader` interface now provides `writeLong`/`writeInt` helpers that can write numeric fields directly without `String.valueOf()` allocation. Implementing `encode()/decode()` on send message headers eliminates the reflection path entirely.
   
   ### Describe the Solution You'd Like
   
   Implement `encode()` and `decode()` methods on:
   - `SendMessageRequestHeader` — 14 fields including Long/Integer types
   - `SendMessageResponseHeader` — 5 fields
   - `SendMessageRequestHeaderV2` — fix `decode()` signature to match interface
   
   ### Additional Context
   
   Depends on R1 (#10522, merged). Related PRs: #10443, #10514, #10526.
   


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

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Enhancement] Implement FastCodesHeader encode/decode for SendMessageRequestHeader/ResponseHeader [rocketmq]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #10533:
URL: https://github.com/apache/rocketmq/issues/10533#issuecomment-4782076102

   **Issue Evaluation**
   
   Category: `type/enhancement` | Status: **Evaluated**
   
   **Feasibility:** Feasible
   **Scope:** `remoting` module — `SendMessageRequestHeader`, `SendMessageResponseHeader`
   **Compatibility:** Backward compatible — adds `FastCodesHeader` implementation alongside existing `encode/decode`.
   
   Same pattern as #10534 — implementing `FastCodesHeader` for send message headers eliminates reflection overhead on the send path. The send path is equally hot, so this optimization is well-justified.
   
   Note: `SendMessageRequestHeaderV2` already implements `FastCodesHeader`, so this would bring V1 headers to parity. Consider whether V1 headers are still actively used or if the effort should focus on V2-only paths.
   
   ---
   *Automated evaluation by RockteMQ-AI*


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

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Enhancement] Implement FastCodesHeader encode/decode for SendMessageRequestHeader/ResponseHeader [rocketmq]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #10533:
URL: https://github.com/apache/rocketmq/issues/10533#issuecomment-4760628023

   **Issue Evaluation**
   
   Category: `type/enhancement` | Status: **Evaluated**
   
   **Feasibility:** Feasible
   **Scope:** `remoting` module — `SendMessageRequestHeader`, `SendMessageResponseHeader`, `SendMessageRequestHeaderV2`
   **Dependency:** R1 (#10522) via PR #10524 — ✅ Merged
   
   **Assessment:**
   - `SendMessageRequestHeader` currently does NOT implement `FastCodesHeader` — confirmed on develop branch. Every send-message RPC goes through `makeCustomHeaderToNet()` reflection path.
   - With R1 merged, `writeLong`/`writeInt` helpers are available for direct primitive writes.
   - `SendMessageRequestHeader` has 14 fields (including Long/Integer), `SendMessageResponseHeader` has 5 fields — eliminating reflection here impacts the entire send-message hot path.
   - `SendMessageRequestHeaderV2.decode()` signature fix is also valid.
   
   This is a high-impact optimization since send-message is the most frequent RPC in RocketMQ. Well-scoped and follows the established R1 pattern.
   
   ---
   *Automated evaluation by RockteMQ-AI*


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

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org