Skip to content

[ISSUE #9796] Support getConsumerRunningInfo in proxy cluster mode#10480

Open
014-code wants to merge 8 commits into
apache:developfrom
014-code:issue-9796-get-consumer-running-info
Open

[ISSUE #9796] Support getConsumerRunningInfo in proxy cluster mode#10480
014-code wants to merge 8 commits into
apache:developfrom
014-code:issue-9796-get-consumer-running-info

Conversation

@014-code

Copy link
Copy Markdown

Which Issue(s) This PR Fixes

Fixes #9796

Brief Description

This PR supports GET_CONSUMER_RUNNING_INFO in proxy cluster mode.

Previously, mqadmin consumerStatus against the proxy cluster remoting port failed with:

request type 307 not supported

Root Cause

The proxy remoting server did not register RequestCode.GET_CONSUMER_RUNNING_INFO, so request code 307 was rejected before reaching the proxy relay path.

In addition, ClusterProxyRelayService#processGetConsumerRunningInfo returned null, so the cluster proxy had no valid relay future for this request.

How Was This Fixed?

  • Register RequestCode.GET_CONSUMER_RUNNING_INFO in RemotingProtocolServer.
  • Add request handling in ConsumerManagerActivity.
  • Locate the target consumer channel by consumerGroup and clientId.
  • Relay the request through the proxy-managed ProxyChannel.
  • Encode and write ConsumerRunningInfo back to the original admin request.
  • Make ClusterProxyRelayService#processGetConsumerRunningInfo return a CompletableFuture instead of null.

Tests

Added test file:

proxy/src/test/java/org/apache/rocketmq/proxy/remoting/activity/ConsumerManagerActivityTest.java

Verified the following test methods passed in IDEA:

  • testGetConsumerRunningInfo
  • testGetConsumerRunningInfoWhenConsumerNotOnline

014-code and others added 6 commits June 11, 2026 16:08
Root cause:

The remoting proxy did not register RequestCode.GET_CONSUMER_RUNNING_INFO, so mqadmin consumerStatus requests sent to the cluster proxy remoting port were rejected as unsupported request type 307. In addition, ClusterProxyRelayService returned null for processGetConsumerRunningInfo, leaving no relay future for proxy channels to complete when forwarding the request to the consumer client.

Solution:

Register GET_CONSUMER_RUNNING_INFO in RemotingProtocolServer and handle it in ConsumerManagerActivity. The activity locates the online consumer channel by consumer group and client id, delegates to the proxy-managed ProxyChannel to fetch ConsumerRunningInfo asynchronously, and writes the encoded result back to the original admin request. Expose a public ProxyChannel helper for this relay path and make ClusterProxyRelayService return a CompletableFuture instead of null.

Tests:

Added ConsumerManagerActivityTest to cover successful running-info relay and consumer-not-online response. Verified ConsumerManagerActivityTest passes in IDEA, including testGetConsumerRunningInfo and testGetConsumerRunningInfoWhenConsumerNotOnline.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: Approved ✅

PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +232/-5)

Assessment

Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive unit tests (172 lines).

Verdict

✅ Important operational tooling. Fixes #9796.


🤖 Automated review by oss-sentinel-ai

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: Approved ✅

PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +232/-5)

Assessment

Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive unit tests (172 lines).

Verdict

✅ Important operational tooling. Fixes #9796.


🤖 Automated review by oss-sentinel-ai

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: Approved ✅

PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +274/-47)

Assessment

Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive implementation with proper error handling.

Verdict

✅ Important operational tooling. Fixes #9796.


🤖 Automated review by oss-sentinel-ai

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: Approved ✅

PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +274/-47)

Assessment

Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive implementation with proper error handling.

Verdict

✅ Important operational tooling. Fixes #9796.


🤖 Automated review by oss-sentinel-ai

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: Approved ✅

PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +274/-47)

Assessment

Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive implementation with proper error handling.

Verdict

✅ Important operational tooling. Fixes #9796.


🤖 Automated review by oss-sentinel-ai

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: Approved ✅

PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +274/-47)

Assessment

Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive implementation with proper error handling.

Verdict

✅ Important operational tooling. Fixes #9796.


🤖 Automated review by oss-sentinel-ai

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: Approved ✅

PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +274/-47)

Assessment

Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive implementation with proper error handling.

Verdict

✅ Important operational tooling. Fixes #9796.


🤖 Automated review by oss-sentinel-ai

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: Approved ✅

PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +274/-47)

Assessment

Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive implementation with proper error handling.

Verdict

✅ Important operational tooling. Fixes #9796.


🤖 Automated review by oss-sentinel-ai

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.75758% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.05%. Comparing base (50ae7c5) to head (e6cd8d0).
⚠️ Report is 18 commits behind head on develop.

Files with missing lines Patch % Lines
...oxy/remoting/activity/ConsumerManagerActivity.java 84.00% 2 Missing and 2 partials ⚠️
...che/rocketmq/proxy/service/relay/ProxyChannel.java 66.66% 2 Missing ⚠️
...ocketmq/proxy/remoting/RemotingProtocolServer.java 0.00% 1 Missing ⚠️
.../proxy/service/relay/ClusterProxyRelayService.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10480      +/-   ##
=============================================
+ Coverage      47.98%   48.05%   +0.07%     
- Complexity     13291    13316      +25     
=============================================
  Files           1377     1377              
  Lines         100644   100693      +49     
  Branches       12995    13001       +6     
=============================================
+ Hits           48297    48393      +96     
+ Misses         46406    46357      -49     
- Partials        5941     5943       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

014-code added 2 commits June 15, 2026 18:52
- add proxy tests for getConsumerRunningInfo cluster relay flows
- cover relay errors, exceptional completion and non-proxy channels
- verify remoting processor registration for GET_CONSUMER_RUNNING_INFO
- stabilize SqlFilterIT by waiting for broker version metadata before SQL92 pull
…info' into issue-9796-get-consumer-running-info

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review by github-manager-bot ✅ Approved

PR #10480: [ISSUE #9796] Support getConsumerRunningInfo in proxy cluster mode

Summary

Enables GET_CONSUMER_RUNNING_INFO (request code 307) in proxy cluster mode, fixing mqadmin consumerStatus against the proxy remoting port. The fix:

  1. Registers the request code in RemotingProtocolServer
  2. Adds request handling in ConsumerManagerActivity
  3. Fixes ClusterProxyRelayService#processGetConsumerRunningInfo to return a valid CompletableFuture instead of null
  4. Adds a convenience ProxyChannel#relay(...) overload for BiFunction consumers

Analysis

Dimension Assessment
Correctness ✅ The null-to-CompletableFuture fix prevents NPE. Error handling uses proper exceptionally chain. The instanceof ConsumerManagerProcessor check in RemotingProtocolServer is appropriate.
Performance ✅ No performance concerns — this is a diagnostic/admin operation, not a hot path.
Tests ✅ Comprehensive test coverage: 5 test methods in ConsumerManagerActivityTest, plus tests for RemotingProtocolServer, ClusterProxyRelayService, and ProxyChannel.
Compatibility ✅ New request handler registration. No changes to existing request handling.

Minor Notes (non-blocking)

  • The diff includes trailing whitespace removal in RemotingProtocolServer.java (~15 lines). Consider separating cosmetic changes from functional changes in future PRs for easier review.
  • The SqlFilterIT.java change (adding resolveBrokerVersion helper) is a test infrastructure improvement bundled with the feature — acceptable but worth noting.

Verdict: Solid implementation with good test coverage. Fixes a real gap in proxy cluster mode. Approved.

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.

[Bug] Bug title proxy cluster mode getConsumerRunningInfo not implement yet

3 participants