Wang1rrr opened a new pull request, #4903:
URL: https://github.com/apache/rocketmq-dashboard/pull/4903
## Which Issue(s) Does This PR Fix?
- Fixes #4799
## What problem does this solve?
`RocketMQMessageProvider.queryByTopic` scans every topic queue with bounded
pull loops, but several early-abandon paths only logged a warning and then
returned a normal `List<MessageRecordVO>`:
- the per-queue pull budget is exhausted;
- the broker returns a null pull result;
- the returned offset does not advance;
- repeated `OFFSET_ILLEGAL` responses force the scan to give up.
A bounded tail scan was also intentionally narrowed without carrying that
fact into the detailed result. The service therefore rendered a partial topic
query as complete whenever fewer than 200 matching rows happened to survive
filtering. This is a read-path completeness invariant violation: operators
could act on an apparently complete result while messages in an unscanned queue
or offset range were omitted.
## What changed?
- Reuse the existing `MessageQueryResult.mayBeTruncated` signal for topic
scans (Option B from #4799), preserving the public API shape.
- Mark the result incomplete for every queue-abandon path and for guarded
tail-budget narrowing.
- Treat null `PullStatus` or `FOUND` with a null message list as malformed
broker responses rather than an exhausted queue.
- Preserve complete results for normal `NO_NEW_MSG`/terminal responses,
retry-topic degradation, and missing-topic responses.
- Update the result Javadoc, web warning, and MCP tool schema so all layers
describe the same completeness semantics.
## Verification
Server:
```text
mvn -B -ntp -Dmaven.repo.local=/tmp/rmq-maven.6P98P5/repo \
-DskipITs \
-Dtest=RocketMQMessageProviderTest,MessageServiceTest,ToolCatalogTest,ToolOutputSchemaContractTest
test
# Tests run: 90, Failures: 0, Errors: 0
```
Web:
```text
npm run build
npx vitest run src/pages/instance/__tests__/MessagePage.test.tsx \
src/pages/instance/__tests__/MessagePageAsyncState.test.tsx
# Test Files: 2 passed; Tests: 33 passed
```
The targeted provider tests cover stalled offsets, null pull responses,
malformed `FOUND` responses, repeated `OFFSET_ILLEGAL`, and guarded tail
truncation.
--
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]