diff --git a/rocketmq-client/src/consumer/consumer_impl/pull_api_wrapper.rs b/rocketmq-client/src/consumer/consumer_impl/pull_api_wrapper.rs index 1de39fed..54f463ff 100644 --- a/rocketmq-client/src/consumer/consumer_impl/pull_api_wrapper.rs +++ b/rocketmq-client/src/consumer/consumer_impl/pull_api_wrapper.rs @@ -272,7 +272,7 @@ impl PullAPIWrapper { let broker_id = self.recalculate_pull_from_which_node(mq); let mut find_broker_result = self .client_instance - .find_broker_address_in_subscribe(broker_name.as_str(), broker_id, false) + .find_broker_address_in_subscribe(&broker_name, broker_id, false) .await; if find_broker_result.is_none() { @@ -286,11 +286,7 @@ impl PullAPIWrapper { let broker_id_again = self.recalculate_pull_from_which_node(mq); find_broker_result = self .client_instance - .find_broker_address_in_subscribe( - broker_name_again.as_str(), - broker_id_again, - false, - ) + .find_broker_address_in_subscribe(&broker_name_again, broker_id_again, false) .await; } diff --git a/rocketmq-client/src/consumer/consumer_impl/re_balance/rebalance_impl.rs b/rocketmq-client/src/consumer/consumer_impl/re_balance/rebalance_impl.rs index aed09c17..5dbafa7e 100644 --- a/rocketmq-client/src/consumer/consumer_impl/re_balance/rebalance_impl.rs +++ b/rocketmq-client/src/consumer/consumer_impl/re_balance/rebalance_impl.rs @@ -845,7 +845,7 @@ where let client = self.client_instance.as_mut().unwrap(); let broker_name = client.get_broker_name_from_message_queue(mq).await; let find_broker_result = client - .find_broker_address_in_subscribe(broker_name.as_str(), mix_all::MASTER_ID, true) + .find_broker_address_in_subscribe(&broker_name, mix_all::MASTER_ID, true) .await; if let Some(find_broker_result) = find_broker_result { let mut request_body = LockBatchRequestBody { @@ -900,11 +900,7 @@ where } let client = client_instance.as_mut().unwrap(); let find_broker_result = client - .find_broker_address_in_subscribe( - broker_name.as_str(), - mix_all::MASTER_ID, - true, - ) + .find_broker_address_in_subscribe(&broker_name, mix_all::MASTER_ID, true) .await; if let Some(find_broker_result) = find_broker_result { let request_body = LockBatchRequestBody { @@ -1018,7 +1014,7 @@ where } let client = self.client_instance.as_mut().unwrap(); let find_broker_result = client - .find_broker_address_in_subscribe(broker_name.as_str(), mix_all::MASTER_ID, true) + .find_broker_address_in_subscribe(&broker_name, mix_all::MASTER_ID, true) .await; if let Some(find_broker_result) = find_broker_result { let request_body = UnlockBatchRequestBody { diff --git a/rocketmq-client/src/consumer/consumer_impl/re_balance/rebalance_push_impl.rs b/rocketmq-client/src/consumer/consumer_impl/re_balance/rebalance_push_impl.rs index 73dfc5a5..95a30d5a 100644 --- a/rocketmq-client/src/consumer/consumer_impl/re_balance/rebalance_push_impl.rs +++ b/rocketmq-client/src/consumer/consumer_impl/re_balance/rebalance_push_impl.rs @@ -441,7 +441,7 @@ impl Rebalance for RebalancePushImpl { }; let broker_name = client.get_broker_name_from_message_queue(mq).await; let find_broker_result = client - .find_broker_address_in_subscribe(broker_name.as_str(), mix_all::MASTER_ID, true) + .find_broker_address_in_subscribe(&broker_name, mix_all::MASTER_ID, true) .await; if let Some(find_broker_result) = find_broker_result { let mut request_body = UnlockBatchRequestBody { diff --git a/rocketmq-client/src/consumer/store/remote_broker_offset_store.rs b/rocketmq-client/src/consumer/store/remote_broker_offset_store.rs index 5c67bbae..30558f40 100644 --- a/rocketmq-client/src/consumer/store/remote_broker_offset_store.rs +++ b/rocketmq-client/src/consumer/store/remote_broker_offset_store.rs @@ -62,7 +62,7 @@ impl RemoteBrokerOffsetStore { let mut find_broker_result = self .client_instance .mut_from_ref() - .find_broker_address_in_subscribe(broker_name.as_str(), mix_all::MASTER_ID, true) + .find_broker_address_in_subscribe(&broker_name, mix_all::MASTER_ID, true) .await; if find_broker_result.is_none() { @@ -77,7 +77,7 @@ impl RemoteBrokerOffsetStore { find_broker_result = self .client_instance .mut_from_ref() - .find_broker_address_in_subscribe(broker_name.as_str(), mix_all::MASTER_ID, false) + .find_broker_address_in_subscribe(&broker_name, mix_all::MASTER_ID, false) .await; } if let Some(find_broker_result) = find_broker_result { @@ -261,7 +261,7 @@ impl OffsetStoreTrait for RemoteBrokerOffsetStore { .await; let mut find_broker_result = self .client_instance - .find_broker_address_in_subscribe(broker_name.as_str(), mix_all::MASTER_ID, false) + .find_broker_address_in_subscribe(&broker_name, mix_all::MASTER_ID, false) .await; if find_broker_result.is_none() { @@ -274,7 +274,7 @@ impl OffsetStoreTrait for RemoteBrokerOffsetStore { .await; find_broker_result = self .client_instance - .find_broker_address_in_subscribe(broker_name.as_str(), mix_all::MASTER_ID, false) + .find_broker_address_in_subscribe(&broker_name, mix_all::MASTER_ID, false) .await; } diff --git a/rocketmq-client/src/factory/mq_client_instance.rs b/rocketmq-client/src/factory/mq_client_instance.rs index a2af5a4a..2f9fe47a 100644 --- a/rocketmq-client/src/factory/mq_client_instance.rs +++ b/rocketmq-client/src/factory/mq_client_instance.rs @@ -1035,7 +1035,7 @@ impl MQClientInstance { pub async fn find_broker_address_in_subscribe( &mut self, - broker_name: &str, + broker_name: &CheetahString, broker_id: u64, only_this_broker: bool, ) -> Option {