hei, one question regarding KafkaSource and .setSt...
# troubleshooting
o
hei, one question regarding KafkaSource and .setStartingOffsets method. What would happen if I use this ? .setStartingOffsets(OffsetsInitializer.earliest()). Does this mean that every new redeployment of the job will read from the beginning of the topic? or the offset will be saved in the state and will pick up next time that we redeploy the job from a savepoint?
m
It depends if you're enabling checkpointing or not
o
I have checkpoint enabled
m
So when you would restart from your checkpoint, Flink would resume where it left of and ignore the setting
o
same applies to savepoint I guess right? whether you resume from checkpoint or savepoint right?
m
Correct, the snapshotting mechanism is the same
o
makes me wonder what the difference is then in between *.setStartingOffsets(OffsetsInitializer.earliest()). and .setStartingOffsets(OffsetsInitializer.co*mmitedOffsets(OfffsetStrategy.EARLIEST))
none in the case we have checkpoint enabled?
the documentation is a bit unclear on this regard
m
I believe in the second one, you could also start from a previously committed offset, and only if those are not available you would start from earliest
But not 100% sure: they are Kafka consumer settings, not specifically Flink settings
o
right, thanks
m
Get an OffsetsInitializer which initializes the offsets to the committed offsets. Use the given OffsetResetStrategy to initialize the offsets if the committed offsets does not exist.
I was right πŸ˜