[ISSUE#4263] Delete topic route info based on cluster when delete topic. (#4268)

* Delete topic route info based on cluster when delete topic.

* Delete useless compatibility code.

* 1.add a non-null judgment to queueDataMap
2.move the judgment of whether there are any key-value pairs in queueDataMap out of the for loop

* When clusterName is null, then delete topic route info in namesrv.
This commit is contained in:
sunxi92
2022-06-06 14:33:35 +08:00
committed by GitHub
parent dd9c74fc0d
commit b1c5fefecf
8 changed files with 57 additions and 13 deletions
@@ -1494,10 +1494,11 @@ public class MQClientAPIImpl {
throw new MQClientException(response.getCode(), response.getRemark());
}
public void deleteTopicInNameServer(final String addr, final String topic, final long timeoutMillis)
public void deleteTopicInNameServer(final String addr, final String topic, final String clusterName, final long timeoutMillis)
throws RemotingException, InterruptedException, MQClientException {
DeleteTopicFromNamesrvRequestHeader requestHeader = new DeleteTopicFromNamesrvRequestHeader();
requestHeader.setTopic(topic);
requestHeader.setClusterName(clusterName);
RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.DELETE_TOPIC_IN_NAMESRV, requestHeader);
RemotingCommand response = this.remotingClient.invokeSync(addr, request, timeoutMillis);