hailin0 commented on code in PR #3085:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3085#discussion_r994684494


##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/serialize/DefaultSeaTunnelRowSerializer.java:
##########
@@ -48,4 +48,10 @@ public ProducerRecord<byte[], byte[]> 
serializeRow(SeaTunnelRow row) {
             return new ProducerRecord<>(topic, null, 
jsonSerializationSchema.serialize(row));
         }
     }
+
+    @Override
+    public ProducerRecord<byte[], byte[]> serializeRowByKey(String key, 
SeaTunnelRow row) {
+        return new ProducerRecord<>(topic, key.getBytes(), 
jsonSerializationSchema.serialize(row));

Review Comment:
   check key is null?



##########
docs/en/connector-v2/sink/Kafka.md:
##########
@@ -50,6 +51,21 @@ In AT_LEAST_ONCE, producer will wait for all outstanding 
messages in the Kafka b
 
 NON does not provide any guarantees: messages may be lost in case of issues on 
the Kafka broker and messages may be duplicated.
 
+### key [string]
+
+Determine the partition of the kafka send message based on the key.

Review Comment:
   Add `support config filed name`



##########
docs/en/connector-v2/sink/Kafka.md:
##########
@@ -21,6 +21,7 @@ By default, we will use 2pc to guarantee the message is sent 
to kafka exactly on
 | bootstrap.servers  | string                 | yes      | -             |
 | kafka.*            | kafka producer config  | no       | -             |
 | semantic           | string                 | no       | NON           |
+| key                | string                 | no       | -           |

Review Comment:
   ```suggestion
   | partition_key      | string                 | no       |-              |
   ```
   
   



-- 
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]

Reply via email to