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)