Question: Can someone point me to what to use for FlinkKafkaProducer in newer versions of Flink as it has been deprecated?

I have some code like this:

```java
FlinkKafkaProducer<String> myKafkaProducer = new FlinkKafkaProducer<String>(
        "kafka-producer",            // target topic
        new SimpleStringSchema(),    // serialization schema
        properties);

```

How would I swap out the deprecated methods? Thanks!

Answer: 
FlinkKafkaProducer has been deprecated

Flink recommends using the new source and sink api in the latest version

Reference to <https://nightlies.apache.org/flink/flink-docs-master/docs/connectors/datastream/kafka/>

```
DataStream<String> stream = ...

KafkaSink<String> sink = KafkaSink.<String>builder()
        .setBootstrapServers(brokers)
        .setRecordSerializer(KafkaRecordSerializationSchema.builder()
            .setTopic("topic-name")
            .setValueSerializationSchema(new SimpleStringSchema())
            .build()
        )
        .setDeliverGuarantee(DeliveryGuarantee.AT_LEAST_ONCE)
        .build();

stream.sinkTo(sink);

```
The Flink 1.14 release notes contain details about `KafkaSink`, which is the successor of `FlinkKafkaProducer`. This includes a migration guide. You can find it at <https://nightlies.apache.org/flink/flink-docs-release-1.14/release-notes/flink-1.14/#port-kafkasink-to-new-unified-sink-api-flip-143>