Pruthvirajj240 opened a new issue, #25983: URL: https://github.com/apache/pulsar/issues/25983
### Search before asking - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar. ### Motivation The Pulsar admin REST endpoint `/admin/v3/persistent/{tenant}/{namespace}/{topic}/subscription/{subName}/position/{messagePosition}` accepts an arbitrary message position. The Java admin client (`Topics.peekMessages` and `peekMessagesAsync`) currently hardcodes position `1`, so callers can only peek from the head of the backlog. The common use case affected is paginated display in admin UIs β to show the 91stβ100th unacknowledged messages, callers have to fetch and discard the first 90, which is wasteful in bandwidth, memory, and time on both client and broker. ### Solution Add a `messagePosition` parameter to `Topics.peekMessages` and `Topics.peekMessagesAsync` in the Java admin client. The new primary method signature: ```java List<Message<byte[]>> peekMessages(String topic, String subName, int messagePosition, int numMessages, boolean showServerMarker, TransactionIsolationLevel transactionIsolationLevel) throws PulsarAdminException; ``` All pre-existing peek overloads become `default` methods delegating to this primary, preserving source and binary compatibility. Full design and compatibility analysis is captured in **PIP-482**: - PIP markdown: https://github.com/Pruthvirajj240/pulsar/blob/pip-482-peek-messageposition/pip/pip-482.md - Pull request: https://github.com/apache/pulsar/pull/25911 ### Alternatives Two alternatives considered and discussed in the PIP under "Alternatives Considered": - `MessageId`-based peek β more powerful but requires server-side changes; deferred to a future PIP. - `PeekOptions` builder β more extensible but a larger API redesign; deferred to a future PIP. ### Anything else? _No response_ ### Are you willing to submit a PR? - [X] I'm willing to submit a PR! (PR #25911 already submitted) -- 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]
