Closed mxsm closed 2 months ago
🚀Thanks for your contribution🎉. CodeRabbit(AI) will review your code first🔥
The pull request introduces significant changes to the RocketMQ client, focusing on enhancing error handling, restructuring modules, and improving the consumer's message processing capabilities. Key modifications include changing the return type of the allocate
method for better error management, introducing new traits and structs for handling message requests, and refining the concurrency model within various components. Additionally, the codebase has been organized to facilitate better modularity and configurability, particularly in consumer behavior and message queue rebalancing.
Files | Change Summary |
---|---|
rocketmq-client/src/consumer/allocate_message_queue_strategy.rs |
Modified allocate method return type from Vec<MessageQueue> to Result<Vec<MessageQueue>> for improved error handling. |
rocketmq-client/src/consumer/consumer_impl.rs |
Added new modules (message_request , pop_request , re_balance ) and a static variable PULL_MAX_IDLE_TIME for improved configuration and organization. |
rocketmq-client/src/consumer/consumer_impl/default_mq_push_consumer_impl.rs |
Refined mq_client_factory type for clarity, updated constructor for rebalance_impl , and changed try_rebalance to an asynchronous function returning Result<bool> . |
rocketmq-client/src/consumer/consumer_impl/message_request.rs |
Removed RebalanceImpl struct and introduced MessageRequest trait for handling message requests flexibly. |
rocketmq-client/src/consumer/consumer_impl/pop_process_queue.rs |
Changed wait_ack_counter from AtomicUsize to Arc<AtomicUsize> for enhanced concurrency and added #[derive(Clone)] for easier cloning. |
rocketmq-client/src/consumer/consumer_impl/pop_request.rs |
Defined PopRequest struct with various fields and methods, implementing the MessageRequest trait. |
rocketmq-client/src/consumer/consumer_impl/process_queue.rs |
Changed tree_map_lock and consume_lock fields to use Arc<RwLock<()>> for improved concurrency. |
rocketmq-client/src/consumer/consumer_impl/pull_request.rs |
Introduced PullRequest struct for managing pull requests, implementing the MessageRequest trait. |
rocketmq-client/src/consumer/consumer_impl/re_balance.rs |
Implemented RebalanceLocal trait for managing queue rebalancing with various methods for handling message queues. |
rocketmq-client/src/consumer/consumer_impl/re_balance/rebalance_impl.rs |
Implemented RebalanceImpl struct for managing message queue rebalancing with methods for subscription management and rebalancing logic. |
rocketmq-client/src/consumer/default_mq_push_consumer.rs |
Simplified allocate_message_queue_strategy type for better usability. |
rocketmq-client/src/factory/mq_client_instance.rs |
Updated MQClientInstance to use a generic type for consumers, enhancing flexibility and performance. |
rocketmq-common/src/common/message/message_queue.rs |
Added Hash , Eq , Ord , and PartialOrd trait implementations to MessageQueue for improved usability in collections. |
rocketmq-remoting/src/protocol/route/route_data_view.rs |
Introduced select_broker_addr method for flexible broker address selection. |
Objective | Addressed | Explanation |
---|---|---|
Support client consumer message-2 (#964) | ✅ |
🐰 In the meadow where the bunnies play,
New features hop in, brightening the day!
With queues that dance and messages that sing,
RocketMQ's magic is a wonderful thing!
So let’s cheer for the code, both clever and neat,
For every change brings a tasty treat! 🌼✨
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?
Attention: Patch coverage is 2.04082%
with 240 lines
in your changes missing coverage. Please review.
Project coverage is 21.44%. Comparing base (
c6def60
) to head (67bad86
). Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Which Issue(s) This PR Fixes(Closes)
Fixes #964
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
New Features
Result
type.PopRequest
andPullRequest
structs for managing pop and pull requests in the messaging system.RebalanceLocal
trait for improved message queue rebalancing functionality.select_broker_addr
method for flexible broker address selection.Bug Fixes
Refactor
ConsumerConfig
andDefaultMQPushConsumerBuilder
.Documentation