apache / apache/rocketmq-dashboard
[Studio][Bug] Consumer group subscriptions and progress return 502 for offline and broadcast groups
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 683
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 58
Description
[Studio][Bug] Consumer group subscriptions and progress return 502 for offline and broadcast groups
## Problem
On the Apache vendor path, two ordinary business states of a consumer group make the group detail drawer fail with an HTTP 502 instead of showing empty live data:
- **Group whose clients have all disconnected** (consumer stopped, app restarted): `GET .../groups/{group}/subscriptions` -> `RocketMQMetadataProvider.getGroupSubscriptions` -> `DefaultMQAdminExt.examineConsumerConnectionInfo` -> **502 "Failed to get subscriptions for group X: CODE: 206 DESC: Not found the consumer group connection ..."**
- **Broadcast-mode group**: `GET .../groups/{group}/progress` -> `getGroupProgress` -> `examineConsumeStats` -> **502 "Failed to get progress for group X: CODE: 213 DESC: Not found the consumer group consume stats, because return offset table is empty, the consumer is under the broadcast mode ..."**
## Evidence
- rocketmq-tools 5.5.0 bytecode (`DefaultMQAdminExtImpl`): `examineConsumerConnectionInfo` throws `MQClientException(206, "Not found the consumer group connection")` when the broker returns an empty connection set; `examineConsumeStats` throws `MQClientException(213, "... the consumer is under the broadcast mode")` for broadcast groups with an empty offset table.
- `RocketMQMetadataProvider.isGroupNotOnline` (RocketMQMetadataProvider.java:726-733 at 6c24d2ed) only matches `MQBrokerException(CONSUMER_NOT_ONLINE)` or a message containing `"not online"` - neither tool-thrown variant matches, so both fall through to `BusinessException(502, ...)`.
- Two new regression tests in `RocketMQMetadataProviderTest` are red on current code with exactly the 502 outputs above (`getGroupSubscriptionsShouldReturnEmptyWhenClientReportsGroupOfflineTest`, `getGroupProgressShouldReturnEmptyForBroadcastGroupTest`).
## Impact
Stopping a consumer or using broadcast consumption is enough to break the subscriptions/progress tabs of the consumer group drawer with an opaque 502, even though the group exists and "no live data" is the correct answer.
## Expected behavior
Both states should be graded like the existing not-online branch: return empty results (subscriptions may still consult the proxy fallback first, as the current not-online path does).
## Related work
- #1251 (closed 2026-08-10, no implementing PR in its timeline) proposed the opposite direction for this endpoint - a structured 502 for subscription diagnostic failures, keeping an empty list only when the broker successfully reports none. This issue is narrower and orthogonal to that proposal: the two states graded here (the tools-thrown MQClientException 206 empty-connection variant and 213 broadcast variant) are "RPC succeeded but there is no business data" states, which the method's existing not-online branch already grades as empty; genuine broker/admin failures still surface as 502 after this change.
- #4006 / merged fix: the same exception family was graded to empty results in `RocketMQClientProvider` (`isGroupConnectionAbsent`, which also matches the message "Not found the consumer group connection"); the drifted copy in `RocketMQMetadataProvider` was missed.
## PR
Fix: #4259.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with RocketMQMetadataProvider.java, especially isGroupNotOnline around lines 726-733, then run the two named regression tests in RocketMQMetadataProviderTest. Compare their behavior with the existing not-online branch and the related RocketMQClientProvider fix; done means both tests pass without changing genuine broker or admin failures into empty results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100