Skip to content

[ISSUE #10671] Improve unsupported client type diagnostics - #10742

Open
twei43846-afk wants to merge 1 commit into
apache:developfrom
twei43846-afk:codex/rocketmq-10671-client-type-diagnostics
Open

[ISSUE #10671] Improve unsupported client type diagnostics#10742
twei43846-afk wants to merge 1 commit into
apache:developfrom
twei43846-afk:codex/rocketmq-10671-client-type-diagnostics

Conversation

@twei43846-afk

Copy link
Copy Markdown

Summary

  • Return a clearer UNRECOGNIZED_CLIENT_TYPE status message when Proxy gRPC heartbeat rejects an unsupported client type.
  • Return the same diagnostic from client termination when cached settings contain an unsupported client type.
  • Add focused ClientActivityTest coverage for both paths.

Motivation

Fixes #10671.

The previous response only echoed the enum name, for example CLIENT_TYPE_UNSPECIFIED, which does not explain why the Proxy rejected the client or which client types are accepted. This keeps the behavior compatible while making the rejection reason visible to clients and adding a Proxy-side warning log.

Tests

  • git diff --check
  • mvn -Dmaven.repo.local=$env:USERPROFILE\.m2\repository -pl proxy -am -Dtest=ClientActivityTest -DfailIfNoTests=false test

Result: ClientActivityTest passed with 17 tests. The local JDK17 run emitted existing JaCoCo 0.8.5 instrumentation warnings for class file version 61, but Maven exited successfully and surefire reports 0 failures / 0 errors.

@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

Summary

Improves diagnostics when the Proxy gRPC layer rejects an unsupported client type in heartbeat and client termination requests. Adds a helper method that produces a descriptive error message listing supported types, and covers both paths with unit tests.

Findings

  • [Info] ClientActivity.java:127-128 — Adding log.warn for unsupported client types in both heartbeat and notifyClientTermination is valuable for operational debugging. Good addition.
  • [Info] ClientActivity.java:202-205 — The buildUnsupportedClientTypeStatus helper reduces duplication and produces a much more informative error message. The message clearly tells the client what went wrong and which types are supported.
  • [Info] ClientActivityTest.java — Tests cover both the heartbeat and termination paths with CLIENT_TYPE_UNSPECIFIED, verifying both the error code and the message content. Good coverage.

Minor Observations

  • The hardcoded list of supported types in the error message (PRODUCER, PUSH_CONSUMER, SIMPLE_CONSUMER, LITE_PUSH_CONSUMER, LITE_SIMPLE_CONSUMER) could become stale if new client types are added to the enum. Consider deriving it from the ClientType enum or a constant in the future. This is a minor concern and acceptable for now.

Assessment

Clean improvement that significantly improves debuggability for clients connecting with unsupported types. Well-tested.


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.

[Feature] Proxy should provide clearer diagnostics when rejecting unsupported gRPC client types

2 participants