You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Wang1rrr (via GitHub)" <gi...@apache.org> on 2026/09/22 03:29:56 UTC

[I] [Bug] A Node.js client connection is reported with no language, and the console calls it unknown [rocketmq-dashboard]

Wang1rrr opened a new issue, #4845:
URL: https://github.com/apache/rocketmq-dashboard/issues/4845

   ### Before Creating the Bug Report
   
   - [x] I have searched the [open issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository and believe that this is not a duplicate.
   - [x] This is a defect in RocketMQ Studio, not a usage question and not a defect in another Apache RocketMQ repository.
   - [x] I can reproduce this on the current `rocketmq-studio` branch (the Studio trunk the pull request template points at), commit `4c697f07acde460e2344375cb1f82669f5b270fd`.
   
   ### Studio Version
   
   ```
   branch: rocketmq-studio
   git commit id: 4c697f07acde460e2344375cb1f82669f5b270fd
   deployed as: built from source
   ```
   
   ### Runtime Environment
   
   ```
   OS: Windows 11 (development box); the defect is in the Apache provider's enum mapping, so the host does not matter
   MySQL: not required - reproduced at the provider layer against a mocked MQAdminExt producer table
   browser (for UI issues): any; the affected console page is web/src/pages/cluster/clients.tsx
   ```
   
   ### Connected RocketMQ Cluster
   
   ```
   RocketMQ version: 5.5.0 (rocketmq-remoting 5.5.0 on the Studio classpath), self-managed
   access mode: Direct to NameServer/Broker - the same path serves Proxy Local and Proxy Cluster
   deployment: any cluster with at least one Node.js SDK client connected
   ```
   
   ### Describe the Bug
   
   `ClientLanguage` has eight members (`common/domain/enums/ClientLanguage.java:21`):
   
   ```java
   Java, Go, Python, Rust, Cpp, CSharp, NodeJS, PHP
   ```
   
   `RocketMQClientProvider.mapLanguage` (`provider/apache/RocketMQClientProvider.java:439`) is the only place that turns a broker-reported `LanguageCode` into one of them, and its switch has seven cases - `JAVA`, `GO`, `PYTHON`, `RUST`, `CPP`, `DOTNET`, `PHP` - with `default: return null`. `LanguageCode.NODE_JS` exists in rocketmq-remoting 5.5.0 (`javap org.apache.rocketmq.remoting.protocol.LanguageCode` lists it after `RUST`), so a Node.js client falls through to `null` and `ClientConnectionVO.language` (`cluster/client/ClientConnectionVO.java:40`) is serialized as `"language": null` - the VO carries no `@JsonInclude(NON_NULL)` and there is no global inclusion override.
   
   The console is already built to display that value, which is what makes the gap visible:
   
   - `web/src/pages/cluster/clients.tsx:101` has `NodeJS: { color: 'lime', label: 'Node.js' }` in `languageConfig`, so the tag, the drawer (`:975`) and the distribution panel all have a rendering ready that never gets used;
   - the Language column filter is generated from that map (`:473`) and matched with `onFilter: (value, record) => record.language === value` (`:478`), so the Node.js filter option is offered and can never match anything;
   - the tag renderer falls back to `languageConfig[lang] ?? { color: 'default', label: lang }` (`:480`), which for `null` draws an empty grey tag;
   - the Language/Version distribution buckets connections with `` `${connection.language} ${connection.version}` `` (`:302`) and later splits that label back apart (`:806`), so a Node.js client is charted under the literal language `null`;
   - the CSV export writes the same field into its `Language` column (`:113`), i.e. an empty cell.
   
   The client diagnostics then treat the missing value as a defect in the user's fleet. `web/src/utils/clientConnectionDiagnostics.ts:107` lists `KNOWN_LANGUAGES` including `'NodeJS'`, `normalizeText` (`:109`) turns `null` into `'unknown'`, and `:315` raises an `UNKNOWN_LANGUAGE` issue - 客户端语言未知 / 该客户端连接的语言不在 Studio 已知语言列表中 - for every single Node.js connection. So a perfectly healthy Node.js SDK client is reported both as an unknown language in the diagnostics panel and as `null` in the distribution chart, and the operator is told to 确认客户端 SDK 语言和采集字段 when the field Studio failed to map is its own.
   
   This is the same shape as the Aliyun `TopicType.LITE` gap: a hand-rolled switch over a vendor vocabulary that has drifted from the Studio enum it feeds, while the rest of the stack already supports the missing member.
   
   ### Steps to Reproduce
   
   1. Start a self-managed RocketMQ cluster and connect any Node.js SDK client (a `rocketmq-clients` Node.js producer or consumer is enough).
   2. Console -> Cluster -> Clients, with that cluster selected.
   3. Look at the Language column, the Language filter, the 语言/版本 distribution panel and the client diagnostics for that connection.
   
   ### What Did You Expect to See?
   
   The connection tagged `Node.js` (lime), matched by the Node.js filter option, bucketed as `NodeJS <version>` in the distribution panel, exported as `NodeJS` in the CSV, and no `UNKNOWN_LANGUAGE` diagnostic - i.e. the same treatment the other seven `ClientLanguage` members already get.
   
   ### What Did You See Instead?
   
   An empty tag in the Language column, a Node.js filter option that matches nothing, a `null` bucket in the distribution chart, an empty CSV cell, and an `UNKNOWN_LANGUAGE` (客户端语言未知) diagnostic on every Node.js connection.
   
   ### Additional Context
   
   Suggested fix, and the one in the pull request I am about to open: add `case NODE_JS: return ClientLanguage.NodeJS;` to `mapLanguage`, and pin the mapping with a test that asserts every `ClientLanguage` member is producible from the scan, so the next enum member cannot be silently dropped.
   
   `LanguageCode` values with no `ClientLanguage` counterpart (`RUBY`, `HTTP`, `OMS`, `OTHER`, `DELPHI`, `ERLANG`) should keep returning `null` - for those the `UNKNOWN_LANGUAGE` diagnostic is honest.
   
   Follow-up worth its own change, deliberately not bundled here: `clients.tsx:302` interpolates a nullable field into the distribution label, so *any* unmapped language still shows up as the literal `null` in that chart. Guarding that label belongs in the web layer.
   
   ### Are You Willing to Submit a Pull Request?
   
   - [x] Yes, I am willing to submit a pull request.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] A Node.js client connection is reported with no language, and the console calls it unknown [rocketmq-dashboard]

Posted by "Wang1rrr (via GitHub)" <gi...@apache.org>.
Wang1rrr commented on issue #4845:
URL: https://github.com/apache/rocketmq-dashboard/issues/4845#issuecomment-5770798890

   Claiming this: https://github.com/apache/rocketmq-dashboard/pull/4846 is up against `rocketmq-studio` with the failing case pinned by a test and mutation-checked against the current behaviour.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] A Node.js client connection is reported with no language, and the console calls it unknown [rocketmq-dashboard]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #4845:
URL: https://github.com/apache/rocketmq-dashboard/issues/4845#issuecomment-5771041288

   **Issue Evaluation**
   
   Category: `bug` | Status: **Confirmed**
   
   The reported issue has been verified against the current codebase (`rocketmq-studio` branch, commit `4c697f07`).
   
   **Root Cause:** `ClientLanguage` enum includes `NodeJS`, but `RocketMQClientProvider.mapLanguage` has no `LanguageCode` → `ClientLanguage.NodeJS` mapping in its switch statement. The `default` branch returns `null`, so Node.js client connections are published with `"language": null`. The frontend then renders an empty/unknown tag because `languageConfig[null]` has no match.
   
   This is the same underlying issue as #4849 but specifically about Node.js clients — the `mapLanguage` method needs a case for the Node.js `LanguageCode` (likely `LanguageCode.JAVASCRIPT` or similar) mapping to `ClientLanguage.NodeJS`.
   
   **Impact:** Node.js client connections show as "unknown" in the clients page, making it impossible to track Node.js SDK adoption.
   **Severity:** Medium — UI/display issue, no functional impact on message processing.
   
   **Suggested fix:** Add the missing `LanguageCode` → `ClientLanguage.NodeJS` case in `mapLanguage`.
   
   An automated fix proposal can be generated. Reply `/approve` to proceed with PR generation.
   
   ---
   *Automated evaluation by RockteMQ-AI*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] A Node.js client connection is reported with no language, and the console calls it unknown [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed issue #4845: [Bug] A Node.js client connection is reported with no language, and the console calls it unknown
URL: https://github.com/apache/rocketmq-dashboard/issues/4845


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] A Node.js client connection is reported with no language, and the console calls it unknown [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on issue #4845:
URL: https://github.com/apache/rocketmq-dashboard/issues/4845#issuecomment-5806538549

   Fixed in 1dbb2bedb (#4846) on the `rocketmq-studio` branch.
   
   Closing manually: GitHub only auto-closes an issue when the pull request is merged into the repository's default branch, and `rocketmq-studio` is not it.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org