MatrixHB opened a new issue, #4114:
URL: https://github.com/apache/rocketmq/issues/4114

   We use the API `queryConsumeTimeSpan` provided by DefaultMQAdminExt when 
querying message within a certain time period on a user console. We found that 
the API `queryConsumeTimeSpan` takes a long time, which cause querying message 
timeout all the time.
    
   The reason is that our broker cluster is relatively large, including over 
100 brokers. In the implement of `queryConsumeTimeSpan`, the client need to 
request all the brokers to fetch consumeTimeSpan information, and the 
request-reply are serial. 
   Original Code:
   ```
           TopicRouteData topicRouteData = this.examineTopicRouteInfo(topic);
           for (BrokerData bd : topicRouteData.getBrokerDatas()) {
               String addr = bd.selectBrokerAddr();
               if (addr != null) {
                   
spanSet.addAll(this.mqClientInstance.getMQClientAPIImpl().queryConsumeTimeSpan(addr,
 topic, group, timeoutMillis));
               }
           }
   ```
   
   In order to improve the performce, we try to add thread pool with 10 core 
threads in `DefaultMQAdminExtImpl`, and execute queryConsumeTimeSpan 
concurrently using CompletableFuture. This thread pool can be shared by other 
APIs in DefaultMQAdminExt.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to