Closed mxsm closed 3 months ago
🚀Thanks for your contribution🎉. CodeRabbit(AI) will review your code first🔥
The changes introduce optimizations and refinements to the process of sending messages in RocketMQ. Key updates include replacing Arc<RwLock<Vec<Box<dyn SendMessageHook>>>
with ArcCellWrapper
, modifying method signatures for better handling of request codes, and updating the BrokerConfig
struct to enhance performance. Additionally, a new inline function is added to the RocketMQMessageStore
trait.
File Path | Change Summary |
---|---|
rocketmq-broker/src/processor.rs |
Replaced Arc<RwLock<Vec<Box<dyn SendMessageHook>>> with ArcCellWrapper , updated method signatures, and property access. |
rocketmq-broker/src/processor/send_message_processor.rs |
Imported ArcCellWrapper , modified method implementations, removed debug logging. |
rocketmq-common/src/common/broker/broker_config.rs |
Updated region_id to return &str and added get_broker_addr method. |
rocketmq-remoting/src/protocol/header/message_operation_header/send_message_request_header.rs |
Updated parse_request_header to include request_code parameter. |
rocketmq-store/src/log_file.rs |
Added now method to RocketMQMessageStore trait. |
sequenceDiagram
participant Client
participant SendMessageProcessorInner
participant SendMessageHook
participant BrokerConfig
Note over Client,SendMessageProcessorInner: Send message flow
Client->>SendMessageProcessorInner: send_message(request)
SendMessageProcessorInner->>BrokerConfig: get_broker_addr()
BrokerConfig-->>SendMessageProcessorInner: broker_addr
SendMessageProcessorInner->>SendMessageHook: execute_send_message_hook_before(context)
SendMessageHook-->>SendMessageProcessorInner: hook executed
SendMessageProcessorInner->>SendMessageHook: execute_send_message_hook_after(response, context)
SendMessageHook-->>SendMessageProcessorInner: hook executed
SendMessageProcessorInner->>Client: send_message_response
Note over Client,SendMessageProcessorInner: Batch message flow
Client->>SendMessageProcessorInner: send_batch_message(request)
SendMessageProcessorInner->>BrokerConfig: get_broker_addr()
BrokerConfig-->>SendMessageProcessorInner: broker_addr
SendMessageProcessorInner->>SendMessageHook: execute_send_message_hook_before(context)
SendMessageHook-->>SendMessageProcessorInner: hook executed
SendMessageProcessorInner->>SendMessageHook: execute_send_message_hook_after(response, context)
SendMessageHook-->>SendMessageProcessorInner: hook executed
SendMessageProcessorInner->>Client: send_batch_message_response
Objective | Addressed | Explanation |
---|---|---|
Optimize and refine the process of sending messages (#788) | ✅ |
In a world where messages fly, RocketMQ reaches for the sky. With ArcCellWrapper in its core, Efficiency is hard to ignore. Hooks now quicker, sleek and bright, Sending messages, oh what a delight! 🚀
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 0%
with 28 lines
in your changes missing coverage. Please review.
Project coverage is 27.65%. Comparing base (
55da831
) to head (5207da9
).
: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 #788
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
New Features
ArcCellWrapper
for managingsend_message_hook_vec
to enhance performance.BrokerConfig
.Improvements
region_id
to return a reference instead of cloning.Refactor
SendMessageProcessorInner
.now
inRocketMQMessageStore
for retrieving current milliseconds.