Closed mxsm closed 2 months ago
🚀Thanks for your contribution🎉. CodeRabbit(AI) will review your code first🔥
The changes introduce improvements to RocketMQ's broker system by making ConsumerFilterData
fields optional, enhancing the ExpressionMessageFilter
, refining the ConsumerFilterManager
, adding new configuration options, and implementing expression evaluation capabilities. These modifications enhance support for consumer filtering based on tags or expressions.
File(s) | Change Summary |
---|---|
rocketmq-broker/src/filter/consumer_filter_data.rs |
Updated ConsumerFilterData struct fields to be optional and adjusted setter methods accordingly. |
rocketmq-broker/src/filter/expression_message_filter.rs |
Added imports, fields, a constructor to ExpressionMessageFilter , and implemented matching methods. |
rocketmq-broker/src/filter/manager/consumer_filter_manager.rs |
Enhanced ConsumerFilterManager by adding new fields and methods, and adjusting existing methods for optional parameters. |
rocketmq-broker/src/filter/manager/consumer_filter_wrapper.rs |
Removed Debug trait and changed topic field type in FilterDataMapByTopic . |
rocketmq-broker/src/processor/pull_message_processor.rs |
Simplified consumer_filter_data construction and enhanced ExpressionMessageFilter instantiation. |
rocketmq-common/src/common/broker/broker_config.rs |
Added new configuration fields and applied the Clone trait to BrokerConfig , TopicQueueConfig , and TimerWheelConfig . |
rocketmq-filter/src/expression.rs |
Introduced a new module for expression evaluation, defining the Expression trait. |
rocketmq-filter/src/lib.rs |
Added expression module. |
rocketmq-filter/src/utils.rs |
Added bloom_filter module. |
rocketmq-remoting/src/protocol/filter/filter_api.rs |
Modified FilterAPI method to handle ExpressionType::TAG differently and simplify subscription_data.expression_type assignment. |
rocketmq-remoting/src/protocol/heartbeat/subscription_data.rs |
Updated SubscriptionData 's Default implementation to use ExpressionType::TAG and set sub_version using get_current_millis() . |
sequenceDiagram
participant Broker
participant FilterAPI
participant ExpressionMessageFilter
participant ConsumerFilterManager
Broker ->> FilterAPI: Parse subscription data
FilterAPI ->> Broker: Returns SubscriptionData
Broker ->> ConsumerFilterManager: Build/Set Up Filter
ConsumerFilterManager ->> Broker: Returns Filter
Broker ->> ExpressionMessageFilter: Create Message Filter
ExpressionMessageFilter ->> Broker: Message Filter Available
Broker ->> ExpressionMessageFilter: Check if message matches filter
ExpressionMessageFilter ->> Broker: Return match result
Objective (Issue #741) | Addressed | Explanation |
---|---|---|
Implement ExpressionMessageFilter tags | ✅ |
In RocketMQ the changes flow, Improved filters now aptly show. Expressions tag, they mark and sort, With harmony, brokers now report. 🐰✨ In code, the balance we maintain, As messages through filters gain.
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?
Which Issue(s) This PR Fixes(Closes)
Fixes #741
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
New Features
BrokerConfig
to enhance configuration flexibility.Updates
Option
types for better handling of optional data.ConsumerFilterManager
to include new methods and fields.PullMessageProcessor
andFilterAPI
.Improvements
SubscriptionData
initialization for more accurate default values.Clone
trait derivation to multiple configuration structs for easier state management.