unbridled-41 opened a new pull request, #5423:
URL: https://github.com/apache/rocketmq-dashboard/pull/5423

   ## Problem / Evidence
   
   `GET /api/topics/{name}/consumers` on an Aliyun instance returns every 
subscribed consumer group with `diffTotal = 0`, `consumeTps = 0` and 
`metricsAvailable = true`, i.e. fabricated measurements.
   
   - `provider/alibaba/AliyunConverters.java:162-168` — `toTopicConsumerVO` 
sets only `group`, `consumeType` and `messageModel`, leaving the VO field 
defaults.
   - `instance/topic/TopicConsumerVO.java:33-36` — `private double consumeTps;` 
/ `private long diffTotal;` with `@Builder.Default private boolean 
metricsAvailable = true;`.
   - The Aliyun response genuinely has no lag/TPS: `javap` on 
`alibabacloud-rocketmq20220801-5.0.8.jar` shows 
`ListTopicSubscriptionsResponseBody$Data` carries only `consistency, 
consumerGroupId, filterExpression, filterExpressionType, messageModel, 
subscriptionStatus, topicName`.
   - Rendering: `web/src/pages/instance/topic.tsx:967,974` renders the number 
unless `metricsAvailable === false`; `TopicDetailOutput.metricsAvailable` 
exposes the same flag to the hosted agent.
   - The Apache provider already handles this exact situation correctly — 
`provider/apache/RocketMQMetadataProvider.java:615-623` builds the row with 
`metricsAvailable(false)` when consume stats cannot be read, and there is an 
existing web test for the unavailable rendering (`TopicPage.test.tsx:1141`).
   
   Impact: an operator diagnosing consumer lag on an Aliyun instance sees "0 
backlog / 0 TPS" as authoritative data for a group that may be falling behind, 
and the AI group/topic tools inherit the same wrong values.
   
   ## Root cause / Fix
   
   The converter assumed the field defaults meant "no lag", but the flag that 
distinguishes "not measured" from "measured zero" is `metricsAvailable`, which 
the defaults set to `true`.
   
   Fix: mark the metrics unavailable in `AliyunConverters.toTopicConsumerVO`, 
matching the Apache provider's convention. No new API call is introduced (the 
console list must not fan out one lag query per group).
   
   ## Priority & scoring
   
   PRIORITY 66 = 影响 26 (silently wrong values feed the console and the AI tool 
contract for every Aliyun instance) + 波及 10 (topic consumer list + detail + AI 
topic output) + 可复现 15 (deterministic for any Aliyun instance) + 维护价值 15 
(restores an established cross-provider convention).
   
   FIX_CONFIDENCE 80: a one-line flag with a regression test; the only 
alternative (per-group `GetConsumerGroupLag` lookups) is a heavier product 
decision left out of scope.
   
   ## Tests
   
   ```
   cd server && mvn -o test 
-Dtest='AliyunConvertersTest,AliyunInstanceProviderTest,AliyunConvertersLagTest,AliyunConvertersBodyEncodingTest'
   ```
   
   - Red before the fix: 
`AliyunConvertersTest.toTopicConsumerVoShouldMarkTheUngettableLagAndTpsUnavailableTest`
 fails (`expecting false but was true`).
   - Green after: `Tests run: 60, Failures: 0, Errors: 0, Skipped: 0`.
   - `mvn -o checkstyle:check` passes.
   
   ## Risk
   
   Low. Only the flag changes; `group`, `consumeType` and `messageModel` are 
untouched. Consumers that render `metricsAvailable === false` as "unavailable" 
now show that instead of a fabricated zero. Apache and Tencent providers are 
unaffected.


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