JingGe commented on a change in pull request #17286:
URL: https://github.com/apache/flink/pull/17286#discussion_r709268898
##########
File path:
flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/table/KafkaChangelogTableITCase.java
##########
@@ -369,14 +380,19 @@ public void testKafkaMaxwellChangelogSource() throws
Exception {
Properties producerProperties = getStandardProps();
producerProperties.setProperty("retries", "0");
try {
- stream.addSink(
- new FlinkKafkaProducer<>(
- topic,
- serSchema,
- producerProperties,
- partitioner,
- EXACTLY_ONCE,
- DEFAULT_KAFKA_PRODUCERS_POOL_SIZE));
+ stream.sinkTo(
+ KafkaSink.<String>builder()
+ .setBootstrapServers(
+ producerProperties.getProperty(
+
ProducerConfig.BOOTSTRAP_SERVERS_CONFIG))
+ .setRecordSerializer(
+ KafkaRecordSerializationSchema.builder()
+ .setTopic(topic)
+
.setValueSerializationSchema(serSchema)
+ .setPartitioner(partitioner)
+ .build())
+
.setDeliverGuarantee(DeliveryGuarantee.EXACTLY_ONCE)
+ .build());
Review comment:
It might be a good idea to extract a private method to avoid triple
duplicated code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]