Closed mxsm closed 2 months ago
🚀Thanks for your contribution🎉. CodeRabbit(AI) will review your code first🔥
The changes integrate new RPC functionalities into the RocketMQ broker, adding RPC client capabilities and client metadata to BrokerOuterAPI
and optimizing the pull message processor for static topics. Enhancements include making methods asynchronous, adding cloning capabilities to structs, and updating configurations to facilitate these improvements.
Files | Change Summary |
---|---|
rocketmq-broker/src/broker_runtime.rs |
Added self.broker_out_api.clone() as a parameter to BrokerController . |
rocketmq-broker/src/out_api/broker_outer_api.rs |
Added rpc_client and client_metadata fields to BrokerOuterAPI , updated new and with_rpc_hook methods. |
rocketmq-broker/src/processor/pull_message_processor.rs |
Added broker_outer_api field to PullMessageProcessor , changed rewrite_request_for_static_topic to be async, and updated method implementations to handle async calls and errors. |
rocketmq-common/src/common/broker/broker_config.rs |
Added forward_timeout field to the BrokerConfig struct with a default value. |
rocketmq-remoting/src/rpc/client_metadata.rs |
Added Clone trait to ClientMetadata struct. |
rocketmq-remoting/src/rpc/rpc_client_impl.rs |
Added Clone trait to RpcClientImpl struct. |
sequenceDiagram
participant BrokerRuntime
participant BrokerController
participant BrokerOuterAPI
participant RpcClient
participant PullMessageProcessor
BrokerRuntime ->> BrokerController: Initialize with broker_out_api.clone()
BrokerController ->> BrokerOuterAPI: Call methods using rpc_client and client_metadata
PullMessageProcessor ->> BrokerOuterAPI: Call rewrite_request_for_static_topic asynchronously
BrokerOuterAPI ->> RpcClient: Make async RPC calls
RpcClient -->> BrokerOuterAPI: Return results
BrokerOuterAPI -->> PullMessageProcessor: Return processed data
Objective | Addressed | Explanation |
---|---|---|
Optimize pull message rewrite static topic (#761) | ✅ |
In the world of RocketMQ, changes vast and grand,
RPCs now flutter, like ships upon the sand.
Async calls now whirl, with efficiency so bright,
Brokers and clients dance, through the code of night.
Forward timeouts set, metadata clones anew,
In the realm of messaging, enhancements now accrue.
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 #761
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
New Features
forward_timeout
configuration with a default value of 3000ms in BrokerConfig.rpc_client
andclient_metadata
in BrokerOuterAPI.Improvements
Clone
trait forClientMetadata
andRpcClientImpl
for better code reuse and flexibility.Refactor
rewrite_request_for_static_topic
function in PullMessageProcessor to be asynchronous.