[ISSUE #7501] The broker supports idempotence in creating topics (#7502)

This commit is contained in:
fuyou001
2023-10-27 16:28:17 +08:00
committed by GitHub
parent 48ef5ced46
commit 26fa050148
@@ -440,6 +440,13 @@ public class AdminBrokerProcessor implements NettyRequestProcessor {
return response;
}
if (topicConfig.equals(this.brokerController.getTopicConfigManager().getTopicConfigTable().get(topic))) {
LOGGER.info("Broker receive request to update or create topic={}, but topicConfig has no changes , so idempotent, caller address={}",
requestHeader.getTopic(), RemotingHelper.parseChannelRemoteAddr(ctx.channel()));
response.setCode(ResponseCode.SUCCESS);
return response;
}
try {
this.brokerController.getTopicConfigManager().updateTopicConfig(topicConfig);
if (brokerController.getBrokerConfig().isEnableSingleTopicRegister()) {