You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "sandeep-mst (via GitHub)" <gi...@apache.org> on 2025/03/17 11:33:26 UTC
[PR] [improve] PIP-411: Expose Peek Messages API to Non-Admin Clients [pulsar]
sandeep-mst opened a new pull request, #24088:
URL: https://github.com/apache/pulsar/pull/24088
<!--
### Contribution Checklist
- PR title format should be *[type][component] summary*. For details, see *[Guideline - Pulsar PR Naming Convention](https://pulsar.apache.org/contribute/develop-semantic-title/)*.
- Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
- Each pull request should address only one issue, not mix up code from multiple issues.
- Each commit in the pull request has a meaningful commit message
- Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
-->
Fixes #24051
Main Issue: #24051
PIP: #411
### Motivation
Apache Pulsar currently exposes the Peek Messages API only under the Admin API, which prevents non-admin applications from using this functionality. Some non-admin applications—such as monitoring tools or custom client applications—need to peek at messages without consuming them. Exposing this functionality via a new endpoint will:
- Enhance usability for a broader range of applications.
- Simplify the development of non-admin clients by providing direct access to message peeking.
- Maintain consistency by leveraging the existing internal Peek Messages logic.
### Modifications
- **Endpoint Creation:**
A new REST endpoint (e.g., `/lookup/peek`) will be added within the Lookup API, enabling non-admin clients to access the Peek Messages functionality.
- **Authorization Checks:**
The new endpoint will include proper authorization checks to ensure that only permitted non-admin clients can use it.
- **Internal Delegation:**
Requests received on the new endpoint will be internally delegated to the existing Peek Messages logic, avoiding code duplication while preserving consistent behavior.
- **Documentation Update:**
The API documentation and reference materials will be updated to include details about the new endpoint, request parameters, response formats, and error conditions.
### Verifying this change
- Added unit and integration tests to validate:
- The new endpoint correctly delegates to the internal Peek Messages logic.
- Authorization checks are enforced as expected.
- Backward compatibility is maintained (existing Admin API remains unchanged).
- Manual testing will be conducted to verify non-admin clients can access the new endpoint while admin clients continue to use the current API.
### Does this pull request potentially affect one of the following parts:
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [x] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
*This PR affects the REST endpoints (by adding a new endpoint) and updates the API documentation accordingly.*
### Documentation
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: https://github.com/cognitree/pulsar/pull/20
--
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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] PIP-411: Expose Peek Messages API to Non-Admin Clients [pulsar]
Posted by "sandeep-mst (via GitHub)" <gi...@apache.org>.
sandeep-mst commented on code in PR #24088:
URL: https://github.com/apache/pulsar/pull/24088#discussion_r2003181437
##########
pip/pip-411.md:
##########
@@ -0,0 +1,82 @@
+# PIP-411: Expose Peek Messages API to Non-Admin Clients
+
+# Background knowledge
+Apache Pulsar currently exposes the Peek Messages API only under the Admin API. This API allows admin to view (peek) messages on a topic without consuming them, but it is tied to admin API prevents non-admin applications from utilizing this functionality.
+
+# Motivation
+Many non-admin applications—such as monitoring tools, debugging utilities, or custom client applications—need the ability to peek at topic messages without using admin API. Exposing this functionality via a new endpoint would:
+- Enhance usability for a broader range of applications.
+- Simplify the development of non-admin clients.
+
+# Goals
+
+## In Scope
+- Introduce a new endpoint (e.g., within the Lookup API) to expose the Peek Messages functionality for non-admin clients.
Review Comment:
We need it for both as `HttpLookupService` and `BinaryProtocolLookupService` are implementations of `LookupService` interface which is used in `org.apache.pulsar.client.impl.PulsarClientImpl`.
This also provides consistency when we use different serviceUrls in conf defined [here](https://github.com/apache/pulsar/blob/32f3577a735581096d85aa961d7df45b9ae9b6f9/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java#L207-L212) for different applications.
Updated the PIP accordingly.
--
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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] PIP-411: Expose Peek Messages API to Non-Admin Clients [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat closed pull request #24088: [improve] PIP-411: Expose Peek Messages API to Non-Admin Clients
URL: https://github.com/apache/pulsar/pull/24088
--
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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] PIP-411: Expose Peek Messages API to Non-Admin Clients [pulsar]
Posted by "eolivelli (via GitHub)" <gi...@apache.org>.
eolivelli commented on code in PR #24088:
URL: https://github.com/apache/pulsar/pull/24088#discussion_r1998570720
##########
pip/pip-411.md:
##########
@@ -0,0 +1,82 @@
+# PIP-411: Expose Peek Messages API to Non-Admin Clients
+
+# Background knowledge
+Apache Pulsar currently exposes the Peek Messages API only under the Admin API. This API allows admin to view (peek) messages on a topic without consuming them, but it is tied to admin API prevents non-admin applications from utilizing this functionality.
+
+# Motivation
+Many non-admin applications—such as monitoring tools, debugging utilities, or custom client applications—need the ability to peek at topic messages without using admin API. Exposing this functionality via a new endpoint would:
+- Enhance usability for a broader range of applications.
+- Simplify the development of non-admin clients.
+
+# Goals
+
+## In Scope
+- Introduce a new endpoint (e.g., within the Lookup API) to expose the Peek Messages functionality for non-admin clients.
Review Comment:
Based on some offline conversation I thought that you needed this on the binary protocol and not on the http API
--
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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve] PIP-411: Expose Peek Messages API to Non-Admin Clients [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on PR #24088:
URL: https://github.com/apache/pulsar/pull/24088#issuecomment-6179366454
Thanks for this proposal. A PIP is accepted through a vote on dev@pulsar.apache.org, and this one doesn't have a discussion or vote thread there. It has been open since March 2025. As part of the open-PR cleanup discussed on dev@, I'm closing PIP proposals that are more than six months old without a passed vote. If you'd like to move it forward, please reopen this PR and start a [DISCUSS] or [VOTE] thread on dev@.
--
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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org