EricJoy2048 commented on code in PR #3742:
URL:
https://github.com/apache/incubator-seatunnel/pull/3742#discussion_r1058319788
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/sink/KafkaSinkWriter.java:
##########
@@ -102,7 +107,8 @@ public KafkaSinkWriter(
@Override
public void write(SeaTunnelRow element) {
- ProducerRecord<byte[], byte[]> producerRecord =
seaTunnelRowSerializer.serializeRow(element);
+ String topic = topicExtractor.apply(element);
Review Comment:
I don't think `topicExtractor.apply(element)` called by each row is a good
idea when `topic` is a fixed value. It means each row will make an unnecessary
regular match.
So, I think you need improve the code and don't call
`topicExtractor.apply(element)` if the `topic` is a fixed value.
--
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]