tju-yxq opened a new issue, #2578: URL: https://github.com/apache/rocketmq-dashboard/issues/2578
## Problem `GET /api/groups/page` advertises server-side pagination, but the current `MetadataService` implementation first calls `listConsumerGroups(...)`: ```java List<ConsumerGroupVO> groups = listConsumerGroups(instanceId, clusterId, search); int total = groups.size(); int from = ... return PageResult.of(groups.subList(from, to), total, page, pageSize); ``` For Apache instances, `listConsumerGroups(...)` is DB-backed and then enriches live online/lag/delay data for every matching group. The paginated endpoint therefore: 1. reads every matching `rmq_group` row; 2. performs live admin/API enrichment for every matching group; 3. builds the full VO list; 4. finally slices one page in memory. With thousands of consumer groups, each page request is still O(total groups), both in database rows and live admin calls. This makes the bounded page endpoint much more expensive than its page size. Topics already have a DB-level `selectPage` implementation (`listTopicsPage`), so consumer groups are inconsistent with the adjacent inventory contract. ## Expected behavior - `GET /api/groups/page` should paginate at the database level for Apache instances. - Read only the current page of matching `rmq_group` rows. - Enrich live stats only for the groups on the returned page. - Preserve existing filters: instance, cluster, and name search. - Preserve stable deterministic ordering (`name ASC, id ASC`). - Return the existing `items / total / page / size` contract unchanged. - Keep the existing unpaginated `GET /api/groups` behavior for callers that intentionally need a full list. - Other providers may keep the default in-memory pagination fallback unless they implement native pagination. ## Verification scope Tests should prove that: - the Apache provider uses `selectPage`, not `selectList`; - the SQL query contains the same instance/cluster/search filters and stable ordering; - live-stat enrichment is only attempted for returned page items; - `MetadataService` delegates pagination to the provider instead of invoking the full-list method; - existing invalid pagination bounds still fail before provider access. -- 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]
