Skip to content

feat: route and audit cluster runtime operations by selected instance - #1244

Open
Aias00 wants to merge 5 commits into
apache:rocketmq-studiofrom
Aias00:feat/studio-instance-scoped-cluster-runtime
Open

feat: route and audit cluster runtime operations by selected instance#1244
Aias00 wants to merge 5 commits into
apache:rocketmq-studiofrom
Aias00:feat/studio-instance-scoped-cluster-runtime

Conversation

@Aias00

@Aias00 Aias00 commented Aug 7, 2026

Copy link
Copy Markdown

Closes #1243
Closes #1262

Summary

  • route Apache cluster discovery, details, and Broker configuration operations through the selected instance endpoint
  • propagate the selected instance through Cluster page APIs while preserving legacy callers without instance context
  • record structured cluster IDs for cluster and Broker configuration audit entries

Validation

  • JAVA_HOME=$(/usr/libexec/java_home -v 21) PATH="$JAVA_HOME/bin:$PATH" mvn -Dtest=ClusterServiceTest,RocketMQBrokerConfigServiceTest,RocketMQClusterProviderTest,AuditServiceTest test
  • npm test -- --run src/api/cluster.test.ts src/api/clusterContract.test.ts src/services/clusterService.test.ts
  • npm run build

Copilot AI lite review requested due to automatic review settings August 7, 2026 09:23

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@RockteMQ-AI RockteMQ-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.

Summary

Adds instance-aware routing to cluster runtime operations — when an instanceId is provided, admin API calls are routed through RuntimeAdminClientResolver instead of the static NameServer config. Falls back cleanly to legacy behavior when instanceId is absent.

Strengths:

  • Backward compatible: all new parameters optional, default methods in ClusterProvider interface
  • Clean routing abstraction via RuntimeAdminClientResolver
  • Frontend correctly uses ref pattern (selectedInstanceIdRef) to avoid stale closures in async callbacks
  • Test mocks properly updated for new constructor dependencies
  • Frontend correctly filters to APACHE vendor instances only

One minor observation:

  • ClusterService.listClusters(String instanceId) log says "Listing all clusters" without including the instanceId — see inline comment.

Overall a well-structured change. LGTM.


Automated review by github-manager-bot

return List.of();
}

public List<ClusterVO> listClusters(String instanceId) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Info] Minor logging improvement: the log message "Listing all clusters" doesn't include the instanceId parameter. Consider adding it for observability, e.g. log.info("Listing clusters for instance: {}", instanceId) when instanceId is present.

@RockteMQ-AI

Copy link
Copy Markdown

⚠️ Merge conflict detected

This PR has conflicts with the base branch and cannot be merged. Please rebase or merge the base branch into your branch and resolve the conflicts:

git fetch origin
git checkout feat/studio-instance-scoped-cluster-runtime
git rebase origin/main
# resolve conflicts, then:
git push --force-with-lease

This is a one-time reminder. Feel free to @mention me for a re-review after conflicts are resolved.


Automated notification by github-manager-bot

@Aias00
Aias00 force-pushed the feat/studio-instance-scoped-cluster-runtime branch from 5f5794d to 52948b6 Compare August 7, 2026 15:07

@RockteMQ-AI RockteMQ-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.

Summary

This PR adds instance-aware routing to cluster runtime operations, enabling the dashboard to target specific RocketMQ instances when listing clusters, viewing cluster details, and updating broker configurations. The changes span both backend (controller → service → provider) and frontend (instance selector UI).

Changes reviewed:

  • Added instanceId parameter to ClusterController endpoints (listClusters, getCluster) as optional request parameter
  • Extended ClusterProvider interface with instance-aware method signatures
  • Updated ApacheClusterProvider to resolve cluster discovery and broker config through selected instance endpoint
  • Added instance selector component to Cluster page in frontend
  • Proper backward compatibility: legacy calls without instanceId retain existing behavior

Assessment:

  • ✅ Clean layered architecture: controller → service → provider with proper separation of concerns
  • ✅ Backward compatible: optional instanceId parameter with required = false
  • ✅ Consistent pattern with other instance-aware operations (Consumer Group, Topic)
  • ✅ Frontend integration adds instance selector for user-facing cluster operations
  • ✅ Good documentation in PR body with verification steps

LGTM — solid multi-instance support for cluster runtime operations.


Automated review by "github-manager-bot"

@Aias00 Aias00 changed the title feat: route cluster runtime operations by selected instance feat: route and audit cluster runtime operations by selected instance Aug 8, 2026
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