youngkermit8-coder opened a new issue, #1608:
URL: https://github.com/apache/rocketmq-dashboard/issues/1608

   ## Problem
   
   `AliyunInstanceProvider.countTopics` delegates to `listTopics(...).size()` 
and `countGroups` delegates to `listConsumerGroups(...).size()`.
   
   The instance list calls both methods for every Aliyun instance. 
Consequently, displaying the list (and checking whether an instance can be 
deleted) fetches and maps every page of both resources only to obtain two 
counts. The Aliyun RocketMQ 5.x responses already expose `Data.totalCount`, so 
the work grows with the number of resources and can consume many OpenAPI 
requests per page load.
   
   ## Reproduction
   
   On the current `rocketmq-studio` branch:
   
   1. Mock `ListTopicsResponseBody.Data` with one returned row and `totalCount 
= 321`.
   2. Call `countTopics(instanceId)`.
   3. The method returns the mapped row count (`1`) instead of the response 
total (`321`) and requests the normal 100-row listing page.
   4. The same behavior occurs for consumer groups (`1` returned with 
`totalCount = 654`).
   
   ## Expected behavior
   
   Each count should issue one minimal first-page request (`pageNumber = 1`, 
`pageSize = 1`) and return the API's `totalCount`, without fetching or mapping 
every resource. Null/malformed response handling should remain safe.
   
   ## Scope
   
   This applies only to Aliyun resource counts. The existing paginated list 
methods should remain unchanged.


-- 
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