You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "JasonLee (Jira)" <ji...@apache.org> on 2021/10/09 04:44:00 UTC

[jira] [Created] (FLINK-24490) The sample code is wrong in Apache Kafka Connector page

JasonLee created FLINK-24490:
--------------------------------

             Summary: The sample code is wrong in Apache Kafka Connector page
                 Key: FLINK-24490
                 URL: https://issues.apache.org/jira/browse/FLINK-24490
             Project: Flink
          Issue Type: Bug
          Components: Documentation
    Affects Versions: 1.14.0
            Reporter: JasonLee
             Fix For: 1.14.0


There is a sample code error in the kafka sink part
{code:java}
// code placeholder
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}
The correct wording should be as follows
{code:java}
// code placeholder
KafkaSink<String> sink = KafkaSink.<String>builder()
        .setKafkaProducerConfig(properties)
        .setBootstrapServers(broker)
        .setRecordSerializer(KafkaRecordSerializationSchema.builder()
                .setTopic(topic)
                .setValueSerializationSchema(new SimpleStringSchema())
                .build()
        ).setDeliverGuarantee(DeliveryGuarantee.EXACTLY_ONCE)
        .build();
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)