RockteMQ-AI commented on issue #4181: URL: https://github.com/apache/rocketmq-dashboard/issues/4181#issuecomment-5595619430
**Issue Evaluation** Category: `bug` | Status: **Confirmed** The reported issue has been verified against the current codebase on the `rocketmq-studio` branch. **Root Cause:** In `RocketMQMessageProvider.java`, the `viewMessageByOffsetId()` path decodes the physical message ID (`offsetMsgId`) to extract the broker address as an IP:port pair (via `decodedBrokerAddr()`). It then validates this address against `knownBrokerEndpoints()`, which collects broker addresses from `ClusterInfo.getBrokerAddrTable()`. When a broker registers with a **resolvable hostname** (e.g., `repro-hostname-broker:10911`) instead of an IP, the registered address and the decoded IP:port will never match as strings, so `validatedBrokerAddr()` rejects the address and returns `null` — causing the query to return empty results. **Affected code:** - `RocketMQMessageProvider#validatedBrokerAddr()` — direct string comparison between decoded IP and registered hostname - `RocketMQMessageProvider#knownBrokerEndpoints()` — collects raw registered addresses without hostname resolution - `RocketMQMessageProvider#decodedBrokerAddr()` — always returns IP from the `InetSocketAddress` in the message ID **Impact:** Any deployment where brokers register with hostnames (common in Kubernetes, Docker, or environments with DNS-based service discovery) cannot query messages by physical message ID through the studio UI. **Severity:** Medium — affects message traceability in hostname-based deployments; topic-based and key-based queries are unaffected. **Suggested fix direction:** Resolve hostnames to IPs (or vice versa) before comparison in `validatedBrokerAddr()`, or maintain a dual lookup map that stores both the registered name and the resolved IP for each broker endpoint. An automated fix proposal can be generated. Reply `/approve` to proceed with PR generation. --- *Automated evaluation by github-manager* -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
