Skip to content

[server][controller][vpj] Add PubSubConsumerAdapter::subscribe with PubSubPosition parameter #1489

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

Merged

Conversation

sushantmane
Copy link
Collaborator

@sushantmane sushantmane commented Jan 31, 2025

Add PubSubConsumerAdapter::subscribe with PubSubPosition parameter

Introduce a new overload of subscribe in PubSubConsumerAdapter that accepts a
PubSubPosition. This change is aimed at supporting non-numeric offsets. This allows
consumers to specify positions such as EARLIEST, LATEST, or an implementation-specific
position type. Implementors must map this PubSubPosition to the appropriate offset in
the underlying pub-sub system.

Enhancements to PubSub Consumer Functionality:

  • PubSubConsumerAdapter:
    Added a new subscribe method that uses PubSubPosition to determine the starting
    offset for consumption. This method is marked with the UnderDevelopment annotation.
    (PubSubConsumerAdapter.java)

  • PubSubPosition Updates:
    Added EARLIEST and LATEST positions to the PubSubPosition interface.
    (PubSubPosition.java)

  • ApacheKafkaConsumerAdapter Implementation:
    Implemented the new subscribe method to handle PubSubPosition.

New Annotations:

  • UnderDevelopment:
    Added a new annotation to indicate that an API is under development and not yet stable.
    (UnderDevelopment.java)

  • VisibleForTesting:
    Added a new annotation to indicate that a method, class, or field is more visible than
    necessary for testing purposes. (VisibleForTesting.java)

How was this PR tested?

UT and E2ETest

Does this PR introduce any user-facing changes?

  • No. You can skip the rest of this section.
  • Yes. Make sure to explain your proposed changes and call out the behavior change.

@sushantmane sushantmane force-pushed the li-pubsub-use--PubSubPosition branch from 1ef6af9 to b6f2e78 Compare January 31, 2025 01:04
Copy link
Contributor

@sixpluszero sixpluszero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. Thanks for the detailed PR description and help me to get understanding of the purpose. I left a few comments but overall it is in good shape to me.

@sushantmane sushantmane force-pushed the li-pubsub-use--PubSubPosition branch from b6f2e78 to 79df243 Compare January 31, 2025 23:14
@sushantmane sushantmane force-pushed the li-pubsub-use--PubSubPosition branch from 79df243 to 7a012c7 Compare January 31, 2025 23:18
@sushantmane
Copy link
Collaborator Author

Thanks, @sixpluszero!

@sushantmane sushantmane merged commit 86259f6 into linkedin:main Feb 1, 2025
57 checks passed
@sushantmane sushantmane deleted the li-pubsub-use--PubSubPosition branch February 1, 2025 18:13
Copy link

@lusong64 lusong64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good comments! I left a recommendation for keeping the reference equal in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants