Closed mxsm closed 3 months ago
The recent changes introduce improvements and bug fixes to the rocketmq-remoting
module. Specifically, they implement the FastCodesHeader
for the PullMessageResponseHeader
struct, correct the write_if_not_null
function to handle the value
parameter correctly, and suppress a UTF-8 related warning during testing.
File | Change Summary |
---|---|
rocketmq-remoting/src/error.rs |
Added #[allow(invalid_from_utf8)] attribute to suppress UTF-8 warning in utf8_error_is_correctly_mapped() test function |
rocketmq-remoting/src/protocol/command_custom_header.rs |
Corrected write_if_not_null to write the value parameter instead of key when value is not empty |
rocketmq-remoting/src/protocol/header/pull_message_response_header.rs |
Implemented FastCodesHeader for PullMessageResponseHeader struct, added constants, and unit tests for encoding and decoding |
sequenceDiagram
participant Client
participant PullMessageResponseHeader
participant HashMap
Client->>PullMessageResponseHeader: Create instance
PullMessageResponseHeader->>HashMap: Convert to map
HashMap-->>PullMessageResponseHeader: Return map data
PullMessageResponseHeader->>Client: Return encoded data
Client->>PullMessageResponseHeader: Decode data from map
PullMessageResponseHeader->>PullMessageResponseHeader: Populate fields
PullMessageResponseHeader-->>Client: Return populated instance
Objective | Addressed | Explanation |
---|---|---|
Implement FastCodesHeader for PullMessageResponseHeader (#782) |
✅ | |
Ensure correct handling of value parameter in write_if_not_null function |
✅ | |
Suppress specific UTF-8 warning during test execution | ✅ |
Amidst the code where bytes align,
A rabbit's touch made functions fine.
With headers swift and values true,
Encoding, decoding, a task anew.
Suppressed the warnings, none to see,
A future bright for RocketMQ! 🚀🐇
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🔥
Which Issue(s) This PR Fixes(Closes)
Fixes #782
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
New Features
PullMessageResponseHeader
to support mapping, encoding, and decoding functionalities.PullMessageResponseHeader
.Bug Fixes
write_if_not_null
function to write thevalue
parameter instead of thekey
parameter.Maintenance