You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/08/09 11:42:48 UTC

[GitHub] [pulsar] kimcs opened a new issue #4928: [java-client] ConsumerBuilder should have option for defaultSubscriptionInitialPosition

kimcs opened a new issue #4928: [java-client] ConsumerBuilder should have option for defaultSubscriptionInitialPosition
URL: https://github.com/apache/pulsar/issues/4928
 
 
   **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 a 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**
   1. 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 easy-of-use than the suggested solution.
   
   1. 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.
   
   1. 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.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services