You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Using the java client, I am unable to continue a subscription from where it was last acknowledged, or from the very beginning of the topic if no such ack is recorded or the subscription is new. If I provide an earliest or latest value to the subscriptionInitialPosition then that value is used instead of continuing from where the subscription was last acked, hence the need for to provide a default when subscribing.
Describe the solution you'd like
Add an option defaultSubscriptionInitialPosition(SubscriptionInitialPosition) to ConsumerBuilder that controls where the subscription should start reading if the subscription is new or has never received an ack.
Describe alternatives you've considered
The default setting of starting a subscription after the most-recent-message (end) of the topic could be controlled at the broker, tenant, namespace or topic level. Any of these alternatives provide less control and ease-of-use than the suggested solution.
Provide a method to read out the last acked message-id directly from the PulsarClient, and combine this with consumer building options similar to the startMessageId and startMessageIdInclusive options of the ReaderBuilder interface. I think this option is less intuitive than having a default initial position option.
Change the behaviour of the current ConsumerBuilder.subscriptionInitialPosition option to use the provided value as a default, but to always continue where the subscription last left-off if an ack has been made on this subscription earlier. This alternative will change the behaviour of existing clients, and is therefore not backwards-compatible, so I would not recommend it.
The text was updated successfully, but these errors were encountered:
I have changed my design and now rely on the pulsar client application to track positions rather than using subscriptions and acknowledgements, so I no longer need this feature for what I'm working on. Still I think this option is useful, as it allows using Pulsar subscriptions to be master of stream progress with at-least-once semantics.
ConsumerBuilder.subscriptionInitialPosition is only applied to the subscription that doesn't exist before. If there is already a subscription created, the consumer will start from where it was left. Hence the existing behavior of ConsumerBuilder.subscriptionInitialPosition already meets your requirements. Is that correct?
Is your feature request related to a problem? Please describe.
Using the java client, I am unable to continue a subscription from where it was last acknowledged, or from the very beginning of the topic if no such ack is recorded or the subscription is new. If I provide an earliest or latest value to the subscriptionInitialPosition then that value is used instead of continuing from where the subscription was last acked, hence the need for to provide a default when subscribing.
Describe the solution you'd like
Add an option defaultSubscriptionInitialPosition(SubscriptionInitialPosition) to ConsumerBuilder that controls where the subscription should start reading if the subscription is new or has never received an ack.
Describe alternatives you've considered
The default setting of starting a subscription after the most-recent-message (end) of the topic could be controlled at the broker, tenant, namespace or topic level. Any of these alternatives provide less control and ease-of-use than the suggested solution.
Provide a method to read out the last acked message-id directly from the PulsarClient, and combine this with consumer building options similar to the startMessageId and startMessageIdInclusive options of the ReaderBuilder interface. I think this option is less intuitive than having a default initial position option.
Change the behaviour of the current ConsumerBuilder.subscriptionInitialPosition option to use the provided value as a default, but to always continue where the subscription last left-off if an ack has been made on this subscription earlier. This alternative will change the behaviour of existing clients, and is therefore not backwards-compatible, so I would not recommend it.
The text was updated successfully, but these errors were encountered: