|Enum Constant and Description|
Semantic.AT_LEAST_ONCE the Flink producer will wait for all outstanding messages in the Kafka buffers to be acknowledged by the Kafka producer on a checkpoint.
Semantic.EXACTLY_ONCE the Flink producer will write all messages in a Kafka transaction that will be committed to the Kafka on a checkpoint.
Semantic.NONE means that nothing will be guaranteed.
|Modifier and Type||Method and Description|
Returns the enum constant of this type with the specified name.
Returns an array containing the constants of this enum type, in the order they are declared.
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
public static final FlinkKafkaProducer011.Semantic EXACTLY_ONCE
In this mode
FlinkKafkaProducer011 sets up a pool of
FlinkKafkaProducer. Between each
checkpoint there is created new Kafka transaction, which is being committed on
TwoPhaseCommitSinkFunction.notifyCheckpointComplete(long). If checkpoint complete notifications are
FlinkKafkaProducer011 can run out of
FlinkKafkaProducers in the pool. In that
case any subsequent
FlinkKafkaProducer011.snapshotState(FunctionSnapshotContext) requests will fail
FlinkKafkaProducer011 will keep using the
FlinkKafkaProducer from previous checkpoint.
To decrease chances of failing checkpoints there are three options:
public static final FlinkKafkaProducer011.Semantic AT_LEAST_ONCE
public static final FlinkKafkaProducer011.Semantic NONE
public static FlinkKafkaProducer011.Semantic values()
for (FlinkKafkaProducer011.Semantic c : FlinkKafkaProducer011.Semantic.values()) System.out.println(c);
public static FlinkKafkaProducer011.Semantic valueOf(String name)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.