nodece commented on code in PR #24652:
URL: https://github.com/apache/pulsar/pull/24652#discussion_r2332006873


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -2236,11 +2237,11 @@ protected CompletableFuture<Void> 
addReplicationCluster(String remoteCluster, Ma
             String localCluster) {
         return 
AbstractReplicator.validatePartitionedTopicAsync(PersistentTopic.this.getName(),
 brokerService)
                 .thenCompose(__ -> 
brokerService.pulsar().getPulsarResources().getClusterResources()
-                        .getClusterAsync(remoteCluster)
-                        .thenApply(clusterData ->
-                                
brokerService.getReplicationClient(remoteCluster, clusterData)))
-                .thenAccept(replicationClient -> {
-                    if (replicationClient == null) {
+                        .getClusterAsync(remoteCluster))
+                .thenAccept((clusterData) -> {
+                    PulsarClient replicationClient = 
brokerService.getReplicationClient(remoteCluster, clusterData);
+                    PulsarAdmin replicationAdmin = 
brokerService.getClusterPulsarAdmin(remoteCluster, clusterData);

Review Comment:
   I will move this logic from PersistentTopic to the replicator.
   
   > `brokerService.getClusterPulsarAdmin` may throw a runtime exception. 
Should we consider it?
   
   If an exception is thrown, this future will be complete with an exception.
   



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to