You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/30 09:18:25 UTC

[GitHub] [pulsar] 315157973 commented on a change in pull request #10348: Reader support seek from separate messageId/time

315157973 commented on a change in pull request #10348:
URL: https://github.com/apache/pulsar/pull/10348#discussion_r623736667



##########
File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Reader.java
##########
@@ -155,6 +157,33 @@
      */
     void seek(long timestamp) throws PulsarClientException;
 
+    /**
+     * Reset the subscription associated with this consumer to a specific message id or message publish time.
+     * <p>
+     * The Function input is topic+partition.
+     * <p>
+     * The return value is the seek position/timestamp of the current partition.
+     * <p>
+     * If returns null, the current partition will not do any processing.
+     * @param function
+     * @throws PulsarClientException
+     */
+    void seek(Function<String, Object> function) throws PulsarClientException;

Review comment:
       Thanks Review.
   If I divide the time and messageId into two interfaces, the flexibility is not so good. Now we can seek time or MessageId at the same time in Function.
   Therefore, I think it can be explained through the documentation. Now if you return an object other than the timestamp and MessageId, an exception will be thrown, and the error will prompt that only timestamp and MessageId are supported
   
   In addition, for throwing exceptions, I will add in the documentation and add corresponding unit tests.




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

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