Skip to content

fix(tools): keep the broadcast track type in messageTrackDetailConcurrent - #11071

Open
zjncs wants to merge 1 commit into
apache:developfrom
zjncs:fix/message-track-concurrent-broadcast
Open

fix(tools): keep the broadcast track type in messageTrackDetailConcurrent#11071
zjncs wants to merge 1 commit into
apache:developfrom
zjncs:fix/message-track-concurrent-broadcast

Conversation

@zjncs

@zjncs zjncs commented Sep 8, 2026

Copy link
Copy Markdown

Motivation

The serial messageTrackDetail maps the broadcast case to a proper track type:

} catch (MQClientException e) {
    if (ResponseCode.CONSUMER_NOT_ONLINE == e.getResponseCode()) {
        mt.setTrackType(TrackType.NOT_ONLINE);
        ...
    }
    if (ResponseCode.BROADCAST_CONSUMPTION == e.getResponseCode()) {
        mt.setTrackType(TrackType.CONSUME_BROADCASTING);
    }
    ...

but the concurrent variant (messageTrackDetailConcurrent, exposed via MQAdminExt.messageTrackDetailConcurrent) only handles CONSUMER_NOT_ONLINE in its catch blocks. For a broadcast consumer group, consumed()examineConsumeStats throws MQClientException(ResponseCode.BROADCAST_CONSUMPTION, ...), so the concurrent API reports the group as TrackType.UNKNOWN with a raw error string, while the serial API correctly reports CONSUME_BROADCASTING — contradicting the sibling implementation and misleading dashboards that use the concurrent API.

Modifications

Add the same BROADCAST_CONSUMPTION → CONSUME_BROADCASTING mapping to both catches of the concurrent track task.

Verification

Fail-before (new test testMessageTrackDetailConcurrentWithBroadcastGroup, run against the unpatched code — a passive consumer group whose connection reports MessageModel.BROADCASTING, so examineConsumeStats throws BROADCAST_CONSUMPTION through the natural path):

Tests run: 1, Failures: 1 -- DefaultMQAdminExtImplTest
expected:<CONSUME_BROADCASTING> but was:<UNKNOWN>

Pass-after:

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 -- DefaultMQAdminExtImplTest#testMessageTrackDetailConcurrentWithBroadcastGroup

Note: the pre-existing testMessageTrackDetailConcurrent (and testConsumeMessageDirectly) fail in my local container on JDK 21 with Mockito cannot mock this class: java.net.InetAddress — verified to fail identically on a clean develop checkout (before my changes), so this is an environment limitation, not a regression of this PR.

…rent

The serial messageTrackDetail maps MQClientException with
BROADCAST_CONSUMPTION to TrackType.CONSUME_BROADCASTING, but the
concurrent variant only handled CONSUMER_NOT_ONLINE, so broadcast
consumer groups were reported as UNKNOWN with an error description.
Mirror the serial mapping in both catches of the concurrent track task.

Signed-off-by: zjncs <18910855655@163.com>
Copilot AI lite review requested due to automatic review settings September 8, 2026 04:44

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
Contributor

Choose a reason for hiding this comment

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

LGTM. Changes look good.


Automated review by github-manager-bot

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