merlimat commented on a change in pull request #1863: Cpp client: add seek 
support in consumer for cpp client
URL: https://github.com/apache/incubator-pulsar/pull/1863#discussion_r192423976
 
 

 ##########
 File path: pulsar-client-cpp/include/pulsar/Consumer.h
 ##########
 @@ -211,6 +211,30 @@ class Consumer {
      */
     void getBrokerConsumerStatsAsync(BrokerConsumerStatsCallback callback);
 
+    /**
+     * Reset the subscription associated with this consumer to a specific 
message id.
+     * The message id can either be a specific message or represent the first 
or last messages in the topic.
+     *
+     * Note: this operation can only be done on non-partitioned topics. For 
these, one can rather perform the
+     * seek() on the individual partitions.
+     *
+     * @param messageId
+     *            the message id where to reposition the subscription
+     */
+    Result seek(const MessageId& msgId);
+
+    /**
+     * Asynchronously reset the subscription associated with this consumer to 
a specific message id.
+     * The message id can either be a specific message or represent the first 
or last messages in the topic.
+     *
+     * Note: this operation can only be done on non-partitioned topics. For 
these, one can rather perform the
+     * seek() on the individual partitions.
+     *
+     * @param messageId
+     *            the message id where to reposition the subscription
+     */
+    virtual void seekAsync(const MessageId& msgId, ResultCallback callback);
 
 Review comment:
   @zhaijack  Can you also expose these in C wrapper API so they can be exposed 
in Go as well?
   
   take a look at `include/pulsar/c/consumer.h" and `lib/c/c_Consumer.cc`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to