[ https://issues.apache.org/jira/browse/FLINK-27730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
liuwei closed FLINK-27730. -------------------------- Resolution: Fixed > Kafka connector document code sink has an error > ----------------------------------------------- > > Key: FLINK-27730 > URL: https://issues.apache.org/jira/browse/FLINK-27730 > Project: Flink > Issue Type: Bug > Components: Documentation > Affects Versions: 1.14.4 > Environment: Flink 1.14.4 > Reporter: liuwei > Priority: Major > Fix For: 1.14.4 > > Attachments: kafka-sink.png, kafka_sink.png > > > Kafka Sink document sample code API call error. > [kafka > sink|https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/connectors/datastream/kafka/] > > {code:java} > KafkaSink<String> sink = KafkaSink.<String>builder() > .setBootstrapServers(brokers) > .setRecordSerializer(KafkaRecordSerializationSchema.builder() > .setTopic("topic-name") > .setValueSerializationSchema(new SimpleStringSchema()) > .setDeliveryGuarantee(DeliveryGuarantee.AT_LEAST_ONCE) > .build() > ) > .build(); {code} > +setDeliveryGuarantee+ is the method of +KafkaSink+ not the method of > {+}KafkaRecordSerializationSchema{+}, as follows: > > {code:java} > KafkaSink<String> sink = KafkaSink.<String>builder() > .setBootstrapServers(brokers) > .setRecordSerializer(KafkaRecordSerializationSchema.builder() > .setTopic("topic-name") > .setValueSerializationSchema(new SimpleStringSchema()) > .build() > ) > .setDeliveryGuarantee(DeliveryGuarantee.AT_LEAST_ONCE) > .build(); {code} > > -- This message was sent by Atlassian Jira (v8.20.7#820007)