You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/10/13 05:57:53 UTC

[GitHub] [flink] mas-chen commented on a diff in pull request #20475: [FLINK-28842][Connector/Kafka] Add client.id.prefix for the KafkaSink

mas-chen commented on code in PR #20475:
URL: https://github.com/apache/flink/pull/20475#discussion_r994178677


##########
flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/sink/KafkaWriter.java:
##########
@@ -398,6 +407,11 @@ private void registerMetricSync() {
                 });
     }
 
+    private String createProducerClientId(Properties props, int subtaskId) {
+        String prefix = props.getProperty(KafkaSinkOptions.CLIENT_ID_PREFIX.key());
+        return prefix + "-" + subtaskId;

Review Comment:
   I think we need to do this for the Commiter as well.
   
   Can we add a string e.g. "writer" and "commiter" to make the client ids distinct?



##########
flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/sink/KafkaSinkOptions.java:
##########
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.connector.kafka.sink;
+
+import org.apache.flink.configuration.ConfigOption;
+import org.apache.flink.configuration.ConfigOptions;
+
+/** Configurations for KafkaSink. */
+public class KafkaSinkOptions {

Review Comment:
   Does it make sense to consolidate connector options like we done in the table API?
   
   https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/table/KafkaConnectorOptions.java
   
   WDYT @PatrickRen?



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org