Skip to content

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

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

Metastarx wants to merge 2 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

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.14451% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.98%. Comparing base (5d68880) to head (6bac291).

Files with missing lines Patch % Lines
...tools/command/lite/GetLiteTopicListSubCommand.java 50.81% 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%   49.98%   +0.21%     
- Complexity     14377    14527     +150     
=============================================
  Files           1390     1393       +3     
  Lines         103262   103435     +173     
  Branches       13504    13522      +18     
=============================================
+ Hits           51392    51698     +306     
+ Misses         45681    45529     -152     
- Partials        6189     6208      +19     

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

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

4 participants