Skip to content
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

As a websocket consumer I need to set InitialSubscriptionPosition to earliest #22969

Closed
2 tasks done
moinessim opened this issue Jun 24, 2024 · 1 comment · Fixed by #23013
Closed
2 tasks done

As a websocket consumer I need to set InitialSubscriptionPosition to earliest #22969

moinessim opened this issue Jun 24, 2024 · 1 comment · Fixed by #23013
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Comments

@moinessim
Copy link
Contributor

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

As a websocket client, I need to subscribe to a persistent topic that has existing messages.
I need to consume all messages, starting from the first (earliest) one, and keep consuming messages as they become available.
Persistent subscription cursor is needed, hence the use of consumer api.

There is no parameter available for this setting shown in the documentation, or in the code that creates the subscription.

There is a similar setting messageId for the Reader endpoint.
But not for the Consumer endpoint.

Solution

Receive a new url parameter "initialSubscriptionPosition", and add the value to the consumer builder using the corresponding java api method.

Alternatives

Use the Reader endpoint: I would really prefer Pulsar to handle the cursor, instead of having to manage that state.

Anything else?

I would be open to implement this myself, if needed.

Thank you very much for your contributions!

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@moinessim moinessim added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Jun 24, 2024
@lhotari
Copy link
Member

lhotari commented Jul 8, 2024

Makes sense to add support for initialSubscriptionPosition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants