shravannarayan-es commented on code in PR #21927:
URL: https://github.com/apache/pulsar/pull/21927#discussion_r1520498959


##########
pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Topics.java:
##########
@@ -1636,6 +1636,27 @@ void expireMessagesForAllSubscriptions(String topic, 
long expireTimeInSeconds)
      */
     CompletableFuture<Void> expireMessagesForAllSubscriptionsAsync(String 
topic, long expireTimeInSeconds);
 
+    /**
+     * Peek messages from a topic subscription.
+     *
+     * @param topic
+     *            topic name
+     * @param subName
+     *            Subscription name
+     * @param  offset
+     *            Start index to start reading messages.
+     * @param numMessages
+     *            Number of messages
+     * @return
+     * @throws NotAuthorizedException
+     *             Don't have admin permission
+     * @throws NotFoundException
+     *             Topic or subscription does not exist
+     * @throws PulsarAdminException
+     *             Unexpected error
+     */
+    List<Message<byte[]>> peekMessages(String topic, String subName, int 
offset, int numMessages) throws PulsarAdminException;

Review Comment:
   Thanks for looking into this. The idea of introducing offset as one of the 
method parameters was to be overwrite offset value of 1 and pass in any number 
as a startingIndex to fetch numMessages of sorts.   This would potentially help 
in paging while pulling messages from a subscription backlog.



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