RockteMQ-AI commented on issue #11423: URL: https://github.com/apache/rocketmq/issues/11423#issuecomment-6147410685
**Issue Evaluation** Category: `type/bug` | Status: **Confirmed** The reported issue has been verified against the current codebase (commit `a7edeecfb`). **Root Cause:** `LocalTopicRouteService.getCurrentMessageQueueView` (line 54-56) retrieves `topicConfig` from the broker's topic config table without a null check, then passes it directly to `toTopicRouteData(topicConfig)`. When the topic does not exist (e.g., after `deleteTopic`, or consumer holding stale assignment), `topicConfig` is null, causing NPE at line 83 (`topicConfig.getPerm()`). **Inconsistency:** The cluster-mode implementation (`ClusterTopicRouteService`) correctly throws `MQClientException(ResponseCode.TOPIC_NOT_EXIST)` via `TopicRouteService.getCacheMessageQueueWrapper` (line 186-194). The local-mode path should mirror this behavior. **Impact:** Any consumer/producer request targeting a non-existent topic in LOCAL-mode proxy will trigger an unhandled NPE instead of a proper error response. **Severity:** Medium — causes unhandled exceptions in proxy, no data loss but degrades error handling. **Suggested fix:** Add a null check in `getCurrentMessageQueueView` before calling `toTopicRouteData`, throwing `MQClientException(TOPIC_NOT_EXIST)` consistent with the cluster-mode behavior. Noted that the reporter has indicated intent to open a PR with the proposed fix. --- *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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
