You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "wawa (Jira)" <ji...@apache.org> on 2022/05/16 15:44:00 UTC

[jira] [Created] (FLINK-27653) Pulsar Connector bug: The startCursor has been setted default value of "MessageId.earliest", Every time to restart the job,the Consumer will do the seek operation.

wawa created FLINK-27653:
----------------------------

             Summary: Pulsar Connector bug: The startCursor has been setted default value of "MessageId.earliest", Every time to restart the job,the Consumer will do the seek operation.
                 Key: FLINK-27653
                 URL: https://issues.apache.org/jira/browse/FLINK-27653
             Project: Flink
          Issue Type: Bug
          Components: API / DataStream
    Affects Versions: 1.14.3
            Reporter: wawa


Pulsar Connector bug: The startCursor has been setted default value of 'MessageId.earliest', Every time to restart the job,the Consumer will do the seek operation.

Of course,we can set like this : '.setStartCursor(StartCursor.latest())', then, when the job restarted, it will do this seek operation : consumer.seek(MessageId.latest). As a result,some messages will be lost.

What we really want is , the consumer can subscribes from where it stopped.

In general, subscribes from 'earliest' or 'latest', we can use the below operation instead of seek:

[ConsumerBuilder|https://pulsar.apache.org/api/client/2.9.0-SNAPSHOT/org/apache/pulsar/client/api/ConsumerBuilder.html]<[T|https://pulsar.apache.org/api/client/2.9.0-SNAPSHOT/org/apache/pulsar/client/api/ConsumerBuilder.html]> subscriptionInitialPosition([SubscriptionInitialPosition |https://pulsar.apache.org/api/client/2.9.0-SNAPSHOT/org/apache/pulsar/client/api/SubscriptionInitialPosition.html]subscriptionInitialPosition)



--
This message was sent by Atlassian Jira
(v8.20.7#820007)