6767import org .apache .pulsar .client .impl .PulsarClientImpl ;
6868import org .apache .pulsar .client .impl .SendCallback ;
6969import org .apache .pulsar .common .api .proto .MarkerType ;
70+ import org .apache .pulsar .common .naming .TopicName ;
7071import org .apache .pulsar .common .policies .data .stats .ReplicatorStatsImpl ;
7172import org .apache .pulsar .common .schema .SchemaInfo ;
7273import org .apache .pulsar .common .stats .Rate ;
@@ -80,6 +81,7 @@ public abstract class PersistentReplicator extends AbstractReplicator
8081
8182 protected final PersistentTopic topic ;
8283 protected final ManagedCursor cursor ;
84+ protected final String localSchemaTopicName ;
8385
8486 protected Optional <DispatchRateLimiter > dispatchRateLimiter = Optional .empty ();
8587 private final Object dispatchRateLimiterLock = new Object ();
@@ -123,6 +125,7 @@ public PersistentReplicator(String localCluster, PersistentTopic localTopic, Man
123125 super (localCluster , localTopic , remoteCluster , remoteTopic , localTopic .getReplicatorPrefix (),
124126 brokerService , replicationClient );
125127 this .topic = localTopic ;
128+ this .localSchemaTopicName = TopicName .getPartitionedTopicName (localTopicName ).toString ();
126129 this .cursor = Objects .requireNonNull (cursor );
127130 this .expiryMonitor = new PersistentMessageExpiryMonitor (localTopic ,
128131 Codec .decode (cursor .getName ()), cursor , null );
@@ -378,7 +381,7 @@ protected CompletableFuture<SchemaInfo> getSchemaInfo(MessageImpl msg) throws Ex
378381 if (msg .getSchemaVersion () == null || msg .getSchemaVersion ().length == 0 ) {
379382 return CompletableFuture .completedFuture (null );
380383 }
381- return client .getSchemaProviderLoadingCache ().get (localTopicName )
384+ return client .getSchemaProviderLoadingCache ().get (localSchemaTopicName )
382385 .getSchemaByVersion (msg .getSchemaVersion ());
383386 }
384387
0 commit comments