Closed mxsm closed 3 months ago
The updates primarily focus on optimizing how topics and other string fields are handled across the RocketMQ broker and remoting modules. This includes switching from explicit string cloning to using string references, thereby improving performance and simplifying the code. Additionally, new structures and methods were introduced to enhance the functionality and consistency in message header handling.
File Path | Change Summary |
---|---|
rocketmq-broker/src/processor/send_message_processor.rs |
Updated topic handling by removing explicit string conversions. |
rocketmq-broker/src/topic/manager/topic_queue_mapping_manager.rs |
Converted topic fields to string for consistency within TopicQueueMappingContext . |
rocketmq-remoting/src/protocol/header/message_operation_header.rs |
Updated return types of TopicRequestHeaderTrait functions to return string references. Added send_message_request_header_v2 module. |
rocketmq-remoting/src/protocol/header/send_message_request_header.rs |
Restructured SendMessageRequestHeader , removed SendMessageRequestHeaderV2 , added serialization/deserialization traits. |
rocketmq-remoting/src/protocol/header/send_message_request_header_v2.rs |
Introduced SendMessageRequestHeaderV2 struct with new fields and methods for enhanced message header handling. |
rocketmq-remoting/src/protocol/header/pull_message_request_header.rs |
Converted string return types to references and replaced clone() with as_str() and as_deref() . |
rocketmq-remoting/src/protocol/header/query_consumer_offset_request_header.rs |
Modified string return types to references for performance optimization. |
rocketmq-remoting/src/protocol/header/update_consumer_offset_header.rs |
Switched string return types to references and used as_deref() instead of clone() . |
Objective | Addressed | Explanation |
---|---|---|
Optimize SendMessageRequestHeader and introduce SendMessageRequestHeaderV2 (Issue #786) |
✅ |
In codes of RocketMQ we delve,
Strings to references, we soon shelve.
Headers optimized with swift delight,
Performance gains are now in sight.
🐇 A rabbit's joy in every byte,
Enhanced and streamlined, pure and bright. 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
🚀Thanks for your contribution🎉. CodeRabbit(AI) will review your code first🔥
Attention: Patch coverage is 58.18966%
with 194 lines
in your changes missing coverage. Please review.
Project coverage is 27.65%. Comparing base (
fc852cd
) to head (297a0f6
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
…HeaderV2🔥
Which Issue(s) This PR Fixes(Closes)
Fixes #786
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
New Features
SendMessageRequestHeaderV2
struct for enhanced message header handling.Improvements
SendMessageRequestHeader
functionality and removed redundantSendMessageRequestHeaderV2
.Bug Fixes