codelipenghui commented on a change in pull request #12517:
URL: https://github.com/apache/pulsar/pull/12517#discussion_r764010266



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Replicator.java
##########
@@ -34,6 +36,15 @@
 
     CompletableFuture<Void> disconnect(boolean b);
 
+    /**
+     * In Function, we can customize which message can be replicate to the 
remote cluster.
+     * The incoming parameter is the original message, the output is whether 
the message should be filtered.
+     * @param filterFunction
+     */
+    default void setFilterFunction(Function<MessageImpl, Boolean> 
filterFunction) {

Review comment:
       I think we can leverage the selective replication 
https://github.com/apache/pulsar/blob/a2b7cae3cfe8d3776483b1ecaf69af47949b70e1/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java#L319
 to avoid introduce the filter function for the replicator.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to