Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.14.4
-
None
-
Flink 1.14.4
Description
Kafka Sink document sample code API call error.
KafkaSink<String> sink = KafkaSink.<String>builder() .setBootstrapServers(brokers) .setRecordSerializer(KafkaRecordSerializationSchema.builder() .setTopic("topic-name") .setValueSerializationSchema(new SimpleStringSchema()) .setDeliveryGuarantee(DeliveryGuarantee.AT_LEAST_ONCE) .build() ) .build();
setDeliveryGuarantee is the method of KafkaSink not the method of KafkaRecordSerializationSchema, as follows:
KafkaSink<String> sink = KafkaSink.<String>builder() .setBootstrapServers(brokers) .setRecordSerializer(KafkaRecordSerializationSchema.builder() .setTopic("topic-name") .setValueSerializationSchema(new SimpleStringSchema()) .build() ) .setDeliveryGuarantee(DeliveryGuarantee.AT_LEAST_ONCE) .build();