Skip to content

Add lite topic listing admin API and mqadmin command - #11451

Open
Metastarx wants to merge 3 commits into
apache:developfrom
Metastarx:patch/feat-add-lite-topic-listing-admin-API-an
Open

Metastarx wants to merge 3 commits into
apache:developfrom
Metastarx:patch/feat-add-lite-topic-listing-admin-API-an

Conversation

@Metastarx

Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes

Brief Description

RocketMQ currently exposes an aggregate lite topic count plus single-topic and single-client lookups, but there is no broker-side way to enumerate the dynamically created lite topics under a parent topic. This change adds a GET_LITE_TOPIC_LIST request with a required parent topic, an optional name prefix, and a bounded maxCount, and the broker returns each lite topic's offsets, last update time, subscriber count, and sharding ownership together with a hasMore truncation flag. The new client, admin, and DefaultMQAdminExt methods are wired through a getLiteTopicList mqadmin command (also available as listLiteTopic) that prints one table row per broker, and the LMQ guide documents the command and sample output.

How Did You Test This Change?

mvn test -pl broker,client,remoting,tools - passed (Tests run: 172, Failures: 0, Errors: 0, Skipped: 5)

Signed-off-by: zhang hongyuan <100520587+Metastarx@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 18, 2026 11:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov-commenter

codecov-commenter commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.56818% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.04%. Comparing base (5d68880) to head (d0f94fa).
⚠️ Report is 13 commits behind head on develop.

Files with missing lines Patch % Lines
...tools/command/lite/GetLiteTopicListSubCommand.java 53.12% 29 Missing and 1 partial ⚠️
...ocketmq/broker/processor/LiteManagerProcessor.java 89.09% 2 Missing and 4 partials ⚠️
...g/apache/rocketmq/client/impl/MQClientAPIImpl.java 0.00% 5 Missing ⚠️
...apache/rocketmq/tools/admin/DefaultMQAdminExt.java 0.00% 1 Missing ⚠️
...he/rocketmq/tools/admin/DefaultMQAdminExtImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #11451      +/-   ##
=============================================
+ Coverage      49.76%   50.04%   +0.28%     
- Complexity     14377    14567     +190     
=============================================
  Files           1390     1394       +4     
  Lines         103262   103557     +295     
  Branches       13504    13548      +44     
=============================================
+ Hits           51392    51830     +438     
+ Misses         45681    45501     -180     
- Partials        6189     6226      +37     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions

  1. Remove broker/null/config/delayOffset.json — likely an accidental commit.
  2. Add a server-side cap on maxCount in the processor (e.g., Math.min(maxCount, 10000)).
  3. Wrap Integer.parseInt in the SubCommand with a user-friendly error message.

Overall

The implementation is clean, follows existing patterns for lite topic admin commands, and has good test coverage. The protocol design (reusing LiteTopicRequestHeader, adding hasMore for pagination) is sound. Addressing the accidental file and the two warnings above would make this ready to merge.


Automated review by github-manager-bot

Signed-off-by: zhang hongyuan <100520587+Metastarx@users.noreply.github.com>
@Metastarx

Copy link
Copy Markdown
Contributor Author

Addressed in bb28e1b.

);
}
if (responseBody.isHasMore()) {
System.out.printf("[%s] returned %d lite topics; increase -m to list more.%n",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we distinguish the broker's hard limit from the requested limit in this hint? Once 10,000 matching lite topics are returned, increasing -m cannot list any more because the broker clamps it to MAX_RETURN_COUNT; suggesting a narrower prefix would give operators an actionable next step.

Signed-off-by: zhang hongyuan <100520587+Metastarx@users.noreply.github.com>
@Metastarx

Copy link
Copy Markdown
Contributor Author

Addressed in d0f94fa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add lite topic listing admin API and command

5 participants