in mqtt-ds/src/main/java/org/apache/rocketmq/mqtt/ds/meta/FirstTopicManager.java [90:113]
public void checkFirstTopicIfCreated(String firstTopic) {
if (topicExistCache.getIfPresent(firstTopic) != null) {
return;
}
if (topicNotExistCache.getIfPresent(firstTopic) != null) {
throw new TopicNotExistException(firstTopic + " NotExist");
}
try {
TopicRouteData topicRouteData = defaultMQAdminExt.examineTopicRouteInfo(firstTopic);
if (topicRouteData == null || topicRouteData.getBrokerDatas() == null || topicRouteData.getBrokerDatas().isEmpty()) {
topicNotExistCache.put(firstTopic, new Object());
throw new TopicNotExistException(firstTopic + " NotExist");
}
updateTopicRoute(firstTopic, topicRouteData);
topicExistCache.put(firstTopic, topicRouteData);
} catch (MQClientException e) {
if (ResponseCode.TOPIC_NOT_EXIST == e.getResponseCode()) {
topicNotExistCache.put(firstTopic, new Object());
throw new TopicNotExistException(firstTopic + " NotExist");
}
} catch (Exception e) {
logger.error("check topic {} exception", firstTopic, e);
}
}