Skip to content

[ISSUE #786] Return unavailable for consumer group providers - #787

Merged
lizhimins merged 1 commit into
apache:rocketmq-studiofrom
Aias00:fix/studio-consumer-group-unavailable
Aug 4, 2026
Merged

[ISSUE #786] Return unavailable for consumer group providers#787
lizhimins merged 1 commit into
apache:rocketmq-studiofrom
Aias00:fix/studio-consumer-group-unavailable

Conversation

@Aias00

@Aias00 Aias00 commented Aug 3, 2026

Copy link
Copy Markdown

Which Issue(s) This PR Fixes

Fixes #786

Brief Description

The default Consumer Group metadata/admin implementations now return explicit BusinessException(501, ...) responses when the backing provider is not configured, instead of throwing plain UnsupportedOperationException and surfacing as generic 500 errors.

This keeps the current Topic paths untouched and only changes Consumer Group operations used by /api/groups.

How Did You Test This Change?

  • JAVA_HOME=/Users/aias/Library/Java/JavaVirtualMachines/openjdk-21.0.2/Contents/Home mvn -Dtest=CloudMetadataProviderTest,NameSrvAdminClientTest,MetadataServiceTest test
  • JAVA_HOME=/Users/aias/Library/Java/JavaVirtualMachines/openjdk-21.0.2/Contents/Home mvn -Dtest=ConsumerGroupControllerTest test

Copilot AI review requested due to automatic review settings August 3, 2026 05:59

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.

Pull request overview

This PR hardens the default Consumer Group provider/admin stubs so /api/groups operations fail with an explicit BusinessException(501, ...) (“not configured”) instead of UnsupportedOperationException, allowing the global exception handler to return HTTP 501 rather than a generic 500.

Changes:

  • Update CloudMetadataProvider Consumer Group query methods to throw BusinessException(501, ...) when no provider is configured.
  • Update NameSrvAdminClient Consumer Group admin methods to throw BusinessException(501, ...) when no admin client is configured.
  • Add focused unit tests verifying the new 501 behavior and message for both default implementations.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
server/src/main/java/org/apache/rocketmq/studio/instance/topic/NameSrvAdminClient.java Switch Consumer Group admin operations from UnsupportedOperationException to BusinessException(501, ...) for clearer API behavior.
server/src/main/java/org/apache/rocketmq/studio/instance/topic/CloudMetadataProvider.java Switch Consumer Group metadata operations from UnsupportedOperationException to BusinessException(501, ...) for clearer API behavior.
server/src/test/java/org/apache/rocketmq/studio/instance/topic/NameSrvAdminClientTest.java Add assertions that default admin client returns BusinessException with code 501 + expected message for Consumer Group operations.
server/src/test/java/org/apache/rocketmq/studio/instance/topic/CloudMetadataProviderTest.java Add assertions that default metadata provider returns BusinessException with code 501 + expected message for Consumer Group operations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lizhimins
lizhimins force-pushed the fix/studio-consumer-group-unavailable branch from c5345dc to 815f451 Compare August 4, 2026 10:03
@lizhimins
lizhimins merged commit 4b0be43 into apache:rocketmq-studio Aug 4, 2026
3 checks passed
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.

3 participants