You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "zjncs (via GitHub)" <gi...@apache.org> on 2026/09/08 06:44:06 UTC
[PR] fix(ai): populate subscriptionMode and consumeType for cloud consumer groups [rocketmq-dashboard]
zjncs opened a new pull request, #4134:
URL: https://github.com/apache/rocketmq-dashboard/pull/4134
## Motivation
The `rmq.group.list` AI tool is **deterministically broken for Aliyun and Tencent instances**:
- `ConsumerGroupListToolHandler.safeProjection` requires both `subscriptionMode` and `consumeType` (`requiredEnumName` throws `IllegalStateException` on the first null).
- `AliyunConverters.toConsumerGroupVO` **never sets `subscriptionMode`** and its `toConsumeType` returns null when the OpenAPI response omits `messageModel`.
- `TencentInstanceProvider.toConsumerGroup` **never sets `subscriptionMode`** either (its consume type is always CLUSTERING).
So the first group of any cloud instance trips `IllegalStateException: Consumer group subscriptionMode is unavailable: <name>` and the whole tool call fails.
This contradicts the invariant the Apache provider already established in `RocketMQMetadataProvider.toConsumerGroupVO`:
```java
// messageModel stores the subscription mode ("Push"/"Pop"); surface it so read paths
// (web detail, AI rmq.group.list) never see a null subscriptionMode.
vo.setSubscriptionMode(parseSubscriptionMode(entity.getMessageModel()));
```
The invariant was fixed for Apache only; both cloud converters were missed. Existing tests never catch it because they always pre-set the enum (e.g. `ToolGatewayServiceTest` builds groups with `SubscriptionMode.Push`).
## Modification
- Both cloud converters emit `SubscriptionMode.Push`: cloud TCP consumer groups are push consumers (Aliyun's `messageModel` carries the consume model, not the subscription mode; Tencent has no POP groups).
- `AliyunConverters.toConsumeType` falls back to `CLUSTERING` for a missing/unrecognized `messageModel`, mirroring `RocketMQMetadataProvider.parseConsumeType` ("falling back to CLUSTERING").
## Verification
`mvn -f server/pom.xml test -Dtest='AliyunInstanceProviderTest,TencentInstanceProviderTest'`
fail-before (fix reverted, tests kept):
```
AliyunInstanceProviderTest.listConsumerGroupsShouldMapGroupIdTest <<< FAILURE! (subscriptionMode was null)
AliyunInstanceProviderTest.listConsumerGroupsShouldFallBackWhenMessageModelMissingTest <<< FAILURE!
TencentInstanceProviderTest.listConsumerGroupsShouldMapAndFilterTest <<< FAILURE! (subscriptionMode was null)
```
pass-after:
```
TencentInstanceProviderTest: Tests run: 43, Failures: 0
AliyunInstanceProviderTest: 27 tests, only getGroupProgressShouldMapLagRowsTest failing —
verified pre-existing on a clean rocketmq-studio checkout (unrelated to this change)
```
Follow-up to the Apache-side invariant; no associated issue — found by code inspection.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ai): populate subscriptionMode and consumeType for cloud consumer groups [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #4134: fix(ai): populate subscriptionMode and consumeType for cloud consumer groups
URL: https://github.com/apache/rocketmq-dashboard/pull/4134
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ai): populate subscriptionMode and consumeType for cloud consumer groups [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on PR #4134:
URL: https://github.com/apache/rocketmq-dashboard/pull/4134#issuecomment-5602087404
Closed as folded into #4115, merged into `rocketmq-studio` as 206314b9.
Your change shipped as-is: both cloud providers now set `SubscriptionMode.Push`, and Aliyun's `toConsumeType` returns `CLUSTERING` instead of null when `messageModel` is absent or not Broadcasting, so `requiredEnumName` no longer throws for every cloud consumer group. Your reasoning for hardcoding Push held up — the pinned `alibabacloud-rocketmq20220801` response body carries no subscription-mode field at all, and it matches what the Apache provider already asserts for its own groups.
This one had to be integrated rather than merged in sequence: it and #4137 both add an import to `AliyunConverters.java` and both extend `AliyunInstanceProviderTest` / `TencentInstanceProviderTest`, so whichever landed second needed a rebase. Putting both on one branch resolved that once, and both sets of tests pass together (44 Tencent, 29 Aliyun).
Nothing further needed from you — thank you for the fix. For context on why these were grouped: the AI resource tool chain had four independent defects (argument-slot routing, output-schema nullability, cloud topic type/perm, cloud consumer-group subscription mode) and merging any single one of them would not have made `rmq.topic.list` or `rmq.group.list` usable, so they were integrated as one change on the target PR's branch, each kept as its own commit with you as the author.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org