Closed mxsm closed 1 month ago
The recent changes enhance the rocketmq-client
library by optimizing message handling and introducing new features for managing sending latency faults. Key modifications include method signature adjustments for better performance, improved error handling, and the addition of capabilities to support compressed message bodies. These updates collectively streamline interactions with message servers and enhance overall efficiency.
Files | Change Summary |
---|---|
rocketmq-client/src/implementation/mq_client_api_impl.rs , rocketmq-remoting/src/clients.rs , rocketmq-remoting/src/clients/rocketmq_default_impl.rs |
Modified get_name_server_address_list to return &[String] instead of Vec<String> for improved performance. |
rocketmq-client/src/producer/default_mq_producer.rs , rocketmq-client/src/producer/producer_impl/default_mq_producer_impl.rs |
Introduced set_send_latency_fault_enable method for managing latency fault settings; improved error handling in send method. |
rocketmq-client/src/latency/mq_fault_strategy.rs |
Added set_send_latency_fault_enable method to control latency fault handling. |
rocketmq-client/src/producer/producer_impl/topic_publish_info.rs |
Added #[inline] attribute to select_one_message_queue for performance optimization. |
rocketmq-common/src/common/message/message_single.rs |
Added compressed_body field to Message struct for handling compressed message data. |
rocketmq-client/src/producer/send_callback.rs |
Introduced SendMessageCallback type alias for improved callback handling. |
sequenceDiagram
participant Client
participant Producer
participant Server
Client->>Producer: send_message(msg)
Producer->>Server: request to send msg
alt Compressed Body
Server-->>Producer: success with compressed_body
else Original Body
Server-->>Producer: success with original_body
end
Producer-->>Client: message sent successfully
Objective | Addressed | Explanation |
---|---|---|
Optimize producer send single message (#886) | ✅ | |
Improve message handling efficiency | ✅ | |
Introduce dynamic control for latency faults | ✅ |
🐇 "In the meadow where messages hop,
We’ve made our sending system top!
With faults now managed, oh so bright,
And messages compressed, what a delight!
Let’s send with speed, not a moment to drop!" 🌼
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 #886
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
New Features
MQFaultStrategy
andDefaultMQProducer
.Message
struct, enhancing data handling flexibility.Bug Fixes
send
method ofDefaultMQProducer
to provide clearer error messages.Performance Improvements