File tree Expand file tree Collapse file tree 4 files changed +19
-5
lines changed
rocketmq-client/src/admin
rocketmq-example/examples/consumer Expand file tree Collapse file tree 4 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -348,8 +348,15 @@ impl MQAdminExt for DefaultMQAdminExtImpl {
348348 async fn examine_topic_route_info (
349349 & self ,
350350 topic : CheetahString ,
351- ) -> crate :: Result < TopicRouteData > {
352- todo ! ( )
351+ ) -> crate :: Result < Option < TopicRouteData > > {
352+ self . client_instance
353+ . as_ref ( )
354+ . unwrap ( )
355+ . mq_client_api_impl
356+ . as_ref ( )
357+ . unwrap ( )
358+ . get_topic_route_info_from_name_server ( & topic, self . timeout_millis . as_millis ( ) as u64 )
359+ . await
353360 }
354361
355362 async fn examine_consumer_connection_info (
Original file line number Diff line number Diff line change @@ -159,7 +159,10 @@ pub trait MQAdminExtLocal: Sync {
159159
160160 async fn examine_broker_cluster_info ( & self ) -> Result < ClusterInfo > ;
161161
162- async fn examine_topic_route_info ( & self , topic : CheetahString ) -> Result < TopicRouteData > ;
162+ async fn examine_topic_route_info (
163+ & self ,
164+ topic : CheetahString ,
165+ ) -> Result < Option < TopicRouteData > > ;
163166
164167 async fn examine_consumer_connection_info (
165168 & self ,
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ async fn switch_pop_consumer() -> Result<()> {
6868 let broker_datas =
6969 MQAdminExt :: examine_topic_route_info ( & mq_admin_ext, CheetahString :: from_static_str ( TOPIC ) )
7070 . await
71+ . unwrap ( )
7172 . unwrap ( ) ;
7273 for broker_data in broker_datas. broker_datas {
7374 let broker_addrs = broker_data
@@ -90,6 +91,7 @@ async fn switch_pop_consumer() -> Result<()> {
9091 . unwrap ( ) ;
9192 }
9293 }
94+ mq_admin_ext. shutdown ( ) . await ;
9395 Ok ( ( ) )
9496}
9597
Original file line number Diff line number Diff line change @@ -366,8 +366,10 @@ impl MQAdminExt for DefaultMQAdminExt {
366366 async fn examine_topic_route_info (
367367 & self ,
368368 topic : CheetahString ,
369- ) -> rocketmq_client_rust:: Result < TopicRouteData > {
370- todo ! ( )
369+ ) -> rocketmq_client_rust:: Result < Option < TopicRouteData > > {
370+ self . default_mqadmin_ext_impl
371+ . examine_topic_route_info ( topic)
372+ . await
371373 }
372374
373375 async fn examine_consumer_connection_info (
You can’t perform that action at this time.
0 commit comments