{"record":{"id":"0713dd1042b2f25a","repo":"apache/rocketmq","slug":"not-found-topic-exception","errorCode":"NOT_FOUND_TOPIC_EXCEPTION","errorMessage":"No route info of this topic: {}","messagePattern":"No route info of this topic: (.+?)","errorType":"exception","errorClass":"MQClientException","httpStatus":null,"severity":"error","filePath":"client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java","lineNumber":890,"sourceCode":"                throw new RemotingTooMuchRequestException(\"sendDefaultImpl call timeout\");\n            }\n\n            if (exception instanceof MQBrokerException) {\n                mqClientException.setResponseCode(((MQBrokerException) exception).getResponseCode());\n            } else if (exception instanceof RemotingConnectException) {\n                mqClientException.setResponseCode(ClientErrorCode.CONNECT_BROKER_EXCEPTION);\n            } else if (exception instanceof RemotingTimeoutException) {\n                mqClientException.setResponseCode(ClientErrorCode.ACCESS_BROKER_TIMEOUT);\n            } else if (exception instanceof MQClientException) {\n                mqClientException.setResponseCode(ClientErrorCode.BROKER_NOT_EXIST_EXCEPTION);\n            }\n\n            throw mqClientException;\n        }\n\n        validateNameServerSetting();\n\n        throw new MQClientException(\"No route info of this topic: \" + msg.getTopic() + FAQUrl.suggestTodo(FAQUrl.NO_TOPIC_ROUTE_INFO),\n            null).setResponseCode(ClientErrorCode.NOT_FOUND_TOPIC_EXCEPTION);\n    }\n\n    private TopicPublishInfo tryToFindTopicPublishInfo(final String topic) {\n        TopicPublishInfo topicPublishInfo = this.topicPublishInfoTable.get(topic);\n        if (null == topicPublishInfo || !topicPublishInfo.ok()) {\n            this.topicPublishInfoTable.putIfAbsent(topic, new TopicPublishInfo());\n            this.mQClientFactory.updateTopicRouteInfoFromNameServer(topic);\n            topicPublishInfo = this.topicPublishInfoTable.get(topic);\n        }\n\n        if (topicPublishInfo.isHaveTopicRouterInfo() || topicPublishInfo.ok()) {\n            return topicPublishInfo;\n        } else {\n            this.mQClientFactory.updateTopicRouteInfoFromNameServer(topic, true, this.defaultMQProducer);\n            topicPublishInfo = this.topicPublishInfoTable.get(topic);\n            return topicPublishInfo;\n        }","sourceCodeStart":872,"sourceCodeEnd":908,"githubUrl":"https://github.com/apache/rocketmq/blob/293f5885719fc4aa3619446a1900f58ccfcfdd29/client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java#L872-L908","documentation":"MQClientException with responseCode ClientErrorCode.NOT_FOUND_TOPIC_EXCEPTION thrown at the tail of sendDefaultImpl: the send loop could not run at all because tryToFindTopicPublishInfo produced no usable TopicPublishInfo, the name server setting passed validation, so the only remaining cause is that the name server knows no route for this topic. Response code NOT_FOUND_TOPIC_EXCEPTION (and the FAQ link) let tooling distinguish missing-topic from other send failures. Same root cause as error 270 but on the plain send() path.","triggerScenarios":"triggerScenarios","commonSituations":"commonSituations","solutions":["Pre-create the topic: sh mqadmin updateTopic -n <namesrv> -c <cluster> -t <topic>; verify with topicList/topicRoute and check the producer's nameserver matches","If auto-creation is acceptable, set broker autoCreateTopicEnable=true and ensure the TBW102 default topic exists","Fix the topic string: correct typos, apply the right namespace (producer.setNamespace) or strip it where unintended","Retry/schedule sends for just-created topics, or bootstrap topic creation in deployment scripts before producers start"],"exampleFix":"// before\nMessage msg = new Message(\"order-events\", body); // topic does not exist\nproducer.send(msg);\n// after\n// ops: sh mqadmin updateTopic -n 10.0.0.1:9876 -c DefaultCluster -t order-events\nMessage msg = new Message(\"order-events\", body);\nproducer.send(msg);","handlingStrategy":"try-catch","validationCode":" // fail fast at startup for known topics\nfor (String topic : requiredTopics) {\n    producer.createTopic(key, topic, 8); // or check route and throw with topic name\n}","typeGuard":null,"tryCatchPattern":"try {\n    producer.send(msg);\n} catch (MQClientException e) {\n    if (e.getResponseCode() == ClientErrorCode.NOT_FOUND_TOPIC_EXCEPTION) {\n        alertOps(\"topic missing: \" + msg.getTopic()); // provisioning problem, do not blind-retry\n    }\n    throw e;\n}","preventionTips":["Create topics as part of infrastructure-as-code, not at runtime","Run a startup probe: fetch route for each required topic, fail deployment if missing","Match nameserver config per environment explicitly (dev/stage/prod)","Handle NOT_FOUND_TOPIC_EXCEPTION by response code and treat it as non-retryable config error"],"tags":["rocketmq","producer","routing","topic-not-found"],"backgroundTag":null,"analyzedSha":"293f5885719fc4aa3619446a1900f58ccfcfdd29","analyzedAt":"2026-08-14T11:50:13.822Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}