hYuang opened a new issue #2864:
URL: https://github.com/apache/rocketmq/issues/2864
**broker/src/main/java/org/apache/rocketmq/broker/topic/TopicConfigManager.java**
public TopicConfig createTopicInSendMessageMethod(final String topic, final
String defaultTopic,
final String remoteAddress, final int clientDefaultTopicQueueNums,
final int topicSysFlag) {
TopicConfig topicConfig = null;
boolean createNew = false;
try {
if (this.lockTopicConfigTable.tryLock(LOCK_TIMEOUT_MILLIS,
TimeUnit.MILLISECONDS)) {
try {
topicConfig = this.topicConfigTable.get(topic);
if (topicConfig != null)
return topicConfig;
TopicConfig defaultTopicConfig =
this.topicConfigTable.get(defaultTopic);
if (defaultTopicConfig != null) {
if
(defaultTopic.equals(TopicValidator.AUTO_CREATE_TOPIC_KEY_TOPIC)) {
if
(!this.brokerController.getBrokerConfig().isAutoCreateTopicEnable()) {
defaultTopicConfig.setPerm(PermName.PERM_READ | PermName.PERM_WRITE);
}
}
if
(PermName.isInherited(defaultTopicConfig.getPerm())) {
topicConfig = new TopicConfig(topic);
_**int queueNums =
clientDefaultTopicQueueNums >
defaultTopicConfig.getWriteQueueNums() ? defaultTopicConfig
.getWriteQueueNums() :
clientDefaultTopicQueueNums;**_
if (queueNums < 0) {
queueNums = 0;
}
topicConfig.setReadQueueNums(queueNums);
topicConfig.setWriteQueueNums(queueNums);
int perm = defaultTopicConfig.getPerm();
perm &= ~PermName.PERM_INHERIT;
topicConfig.setPerm(perm);
topicConfig.setTopicSysFlag(topicSysFlag);
topicConfig.setTopicFilterType(defaultTopicConfig.getTopicFilterType());
} else {
log.warn("Create new topic failed, because the
default topic[{}] has no perm [{}] producer:[{}]",
defaultTopic, defaultTopicConfig.getPerm(),
remoteAddress);
}
}
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]