public static enum FlinkKafkaProducer.Semantic extends Enum<FlinkKafkaProducer.Semantic>
| Enum Constant and Description |
|---|
AT_LEAST_ONCE
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.
|
EXACTLY_ONCE
Semantic.EXACTLY_ONCE the Flink producer will write all messages in a Kafka transaction that will be
committed to Kafka on a checkpoint.
|
NONE
Semantic.NONE means that nothing will be guaranteed.
|
| Modifier and Type | Method and Description |
|---|---|
static FlinkKafkaProducer.Semantic |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FlinkKafkaProducer.Semantic[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FlinkKafkaProducer.Semantic EXACTLY_ONCE
In this mode FlinkKafkaProducer sets up a pool of FlinkKafkaInternalProducer. Between each
checkpoint a Kafka transaction is created, which is committed on
TwoPhaseCommitSinkFunction.notifyCheckpointComplete(long). If checkpoint complete notifications are
running late, FlinkKafkaProducer can run out of FlinkKafkaInternalProducers in the pool. In that
case any subsequent FlinkKafkaProducer.snapshotState(FunctionSnapshotContext) requests will fail
and FlinkKafkaProducer will keep using the FlinkKafkaInternalProducer
from the previous checkpoint.
To decrease the chance of failing checkpoints there are three options:
FlinkKafkaInternalProducers poolpublic static final FlinkKafkaProducer.Semantic AT_LEAST_ONCE
public static final FlinkKafkaProducer.Semantic NONE
public static FlinkKafkaProducer.Semantic[] values()
for (FlinkKafkaProducer.Semantic c : FlinkKafkaProducer.Semantic.values()) System.out.println(c);
public static FlinkKafkaProducer.Semantic valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.