BewareMyPower commented on code in PR #21927: URL: https://github.com/apache/pulsar/pull/21927#discussion_r1519137945
########## 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: Pulsar does not use the "offset" concept like Kafka or some other messaging systems. So it might be a little confusing here. Instead, you can use `messagePosition` like the name in https://github.com/apache/pulsar/blob/c36c18d44fd4df07bce9b7961c59685e0e91a420/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicsImpl.java#L870 -- 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