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-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to