Skip to content

[improve] PIP-411: Expose Peek Messages API to Non-Admin Clients #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sandeep-mst
Copy link
Collaborator

@sandeep-mst sandeep-mst commented Mar 17, 2025

Fixes apache#24051

Main Issue: apache#24051

PIP: apache#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
  • 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
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions bot added the PIP label Mar 17, 2025
@sandeep-mst sandeep-mst changed the title [improve] PIP-411: Introduce pending publish buffer usage metrics [improve] PIP-411: Expose Peek Messages API to Non-Admin Clients Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

[Enhancement] Make Peek Messages API available for non-admin clients
1 participant