You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "mfvitale (via GitHub)" <gi...@apache.org> on 2026/01/19 11:25:12 UTC

[PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

mfvitale opened a new pull request, #21330:
URL: https://github.com/apache/kafka/pull/21330

   This improvement, related to [KIP-1272](https://cwiki.apache.org/confluence/display/KAFKA/KIP-1272%3A+Improve+Connect+configurable+components+discoverability),  introduces a common `ConfigSpecifier` interface for Kafka Connect components that expose configuration metadata. 
   By unifying the existing `config()` method across connectors, converters, transformations, and predicates under a single contract, it simplifies component discovery, reduces code duplication, and enables uniform tooling for configuration introspection, validation, documentation, and UI generation. 
   The change is fully backward compatible and requires no modifications to existing component implementations.
   


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2882932149


##########
connect/api/src/main/java/org/apache/kafka/connect/rest/ConnectRestExtension.java:
##########
@@ -60,4 +61,24 @@ public interface ConnectRestExtension extends Configurable, Versioned, Closeable
      *                          ConnectRestExtensionContext#configurable()}
      */
     void register(ConnectRestExtensionContext restPluginContext);
+
+    /**
+     * Configuration specification for this rest extension.
+     *
+     * @return the configuration definition for this rest extension; never null
+     */
+    @Override
+    default ConfigDef config() {
+        return new ConfigDef();
+    }
+
+    /**
+     * Get the version of this component.
+     *
+     * @return the version, formatted as a String. The version may not be {@code null} or empty.
+     */
+    @Override
+    default String version() {
+        return "undefined";
+    }

Review Comment:
   We don't need this default method? `ConnectRestExtension` already implemented `Versioned`, so all implementation should already define it.



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mfvitale (via GitHub)" <gi...@apache.org>.
mfvitale commented on PR #21330:
URL: https://github.com/apache/kafka/pull/21330#issuecomment-3984902246

   @mimaison comments addressed. 


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mfvitale (via GitHub)" <gi...@apache.org>.
mfvitale commented on PR #21330:
URL: https://github.com/apache/kafka/pull/21330#issuecomment-4048631717

   @mimaison Do you think we can target this for 4.3?


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison merged PR #21330:
URL: https://github.com/apache/kafka/pull/21330


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2846630360


##########
connect/api/src/main/java/org/apache/kafka/connect/components/ConnectPlugin.java:
##########
@@ -0,0 +1,53 @@
+/*
+ * 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.kafka.connect.components;
+
+import org.apache.kafka.common.config.ConfigDef;
+
+/**
+ * Interface for components that provide version and configuration specifications.
+ * This interface establishes a common contract for all Kafka Connect components
+ * that define a version and expose configurable properties, enabling uniform discovery and introspection
+ * of component configurations.
+ *
+ * <p>Components implementing this interface declare their version and configuration requirements
+ * through a {@link ConfigDef} object, which describes the configuration properties
+ * including their names, types, default values, validators, and documentation.
+
+ *
+ */
+public interface ConnectPlugin {
+
+    /**
+     * Get the version of this component.
+     *
+     * @return the version, formatted as a String. The version may not be {@code null} or empty.
+     */
+    String version();

Review Comment:
   Should the interface extend `Versioned` instead of redefining the `version()` method?



##########
connect/api/src/main/java/org/apache/kafka/connect/transforms/predicates/Predicate.java:
##########
@@ -37,13 +38,14 @@
  *
  * @param <R> The type of record.
  */
-public interface Predicate<R extends ConnectRecord<R>> extends Configurable, AutoCloseable {
+public interface Predicate<R extends ConnectRecord<R>> extends Configurable, AutoCloseable, ConnectPlugin {

Review Comment:
   Don't we need a default `version()` implementation here? Existing `Predicate` implementations may not override `version()`



##########
connect/api/src/main/java/org/apache/kafka/connect/transforms/Transformation.java:
##########
@@ -36,7 +37,7 @@
  *
  * @param <R> The type of record (must be an implementation of {@link ConnectRecord})
  */
-public interface Transformation<R extends ConnectRecord<R>> extends Configurable, Closeable {
+public interface Transformation<R extends ConnectRecord<R>> extends Configurable, Closeable, ConnectPlugin {

Review Comment:
   Don't we need a default `version()` implementation here? Existing`Transformation` implementations may not override `version()`



##########
connect/api/src/main/java/org/apache/kafka/connect/storage/HeaderConverter.java:
##########
@@ -61,5 +62,16 @@ public interface HeaderConverter extends Configurable, Closeable {
      * Configuration specification for this set of header converters.
      * @return the configuration specification; may not be null
      */
+    @Override
     ConfigDef config();

Review Comment:
   Do we need to keep this here?



##########
connect/api/src/main/java/org/apache/kafka/connect/storage/StringConverter.java:
##########
@@ -42,7 +41,7 @@
  * <p>
  * This implementation currently does nothing with the topic names or header keys.
  */
-public class StringConverter implements Converter, HeaderConverter, Versioned {
+public class StringConverter implements Converter, HeaderConverter {

Review Comment:
   I think we can do the same on the other Converters too `BooleanConverter`, `ByteArrayConverter`, etc



##########
connect/api/src/main/java/org/apache/kafka/connect/transforms/predicates/Predicate.java:
##########
@@ -37,13 +38,14 @@
  *
  * @param <R> The type of record.
  */
-public interface Predicate<R extends ConnectRecord<R>> extends Configurable, AutoCloseable {
+public interface Predicate<R extends ConnectRecord<R>> extends Configurable, AutoCloseable, ConnectPlugin {

Review Comment:
   If so we can remove `implements Versioned` in all the built-in `Predicate` Kafka has



##########
connect/api/src/main/java/org/apache/kafka/connect/transforms/Transformation.java:
##########
@@ -36,7 +37,7 @@
  *
  * @param <R> The type of record (must be an implementation of {@link ConnectRecord})
  */
-public interface Transformation<R extends ConnectRecord<R>> extends Configurable, Closeable {
+public interface Transformation<R extends ConnectRecord<R>> extends Configurable, Closeable, ConnectPlugin {

Review Comment:
   If so we can remove `implements Versioned` in all the built-in `Transformation` Kafka has



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mfvitale (via GitHub)" <gi...@apache.org>.
mfvitale commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2890970658


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/ConnectorConfigTest.java:
##########
@@ -410,7 +410,7 @@ public AbstractTestPredicate() { }
 
     }
 
-    public abstract static class AbstractTransformation<R extends ConnectRecord<R>> implements Transformation<R>, Versioned  {
+    public abstract static class AbstractTransformation<R extends ConnectRecord<R>> implements Transformation<R>  {

Review Comment:
   I went through all `implements Versioned` and also discovered others. 



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mfvitale (via GitHub)" <gi...@apache.org>.
mfvitale commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2926090410


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/PluginsTest.java:
##########
@@ -777,7 +771,7 @@ public String version() {
         }
     }
 
-    public static class TestInternalConverter extends JsonConverter implements Versioned {
+    public static class TestInternalConverter extends JsonConverter {

Review Comment:
   Test passes, so I removed it. 



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mfvitale (via GitHub)" <gi...@apache.org>.
mfvitale commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2872844444


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/ConnectorConfigTest.java:
##########
@@ -377,6 +377,11 @@ public static class TestPredicate<R extends ConnectRecord<R>> implements Predica
 
         public TestPredicate() { }
 
+        @Override
+        public String version() {
+            return "";

Review Comment:
   I remove the one I added since now is no more required. I leaved the other that was already present. 



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mfvitale (via GitHub)" <gi...@apache.org>.
mfvitale commented on PR #21330:
URL: https://github.com/apache/kafka/pull/21330#issuecomment-4032777017

   @mimaison thanks. I have addressed the comments. 


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2925230032


##########
connect/runtime/src/test/resources/test-plugins/non-migrated/test/plugins/NonMigratedConverter.java:
##########
@@ -43,4 +43,9 @@ public byte[] fromConnectData(final String topic, final Schema schema, final Obj
   public SchemaAndValue toConnectData(final String topic, final byte[] value) {
     return null;
   }
+
+    @Override
+    public String version() {
+        return "1.0.0";
+    }

Review Comment:
   Is this needed?
   Same in the other files below



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mfvitale (via GitHub)" <gi...@apache.org>.
mfvitale commented on PR #21330:
URL: https://github.com/apache/kafka/pull/21330#issuecomment-3958105366

   @mimaison thanks for the review. I have addressed your comments. 


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mfvitale (via GitHub)" <gi...@apache.org>.
mfvitale commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2883265451


##########
connect/api/src/main/java/org/apache/kafka/connect/rest/ConnectRestExtension.java:
##########
@@ -60,4 +61,24 @@ public interface ConnectRestExtension extends Configurable, Versioned, Closeable
      *                          ConnectRestExtensionContext#configurable()}
      */
     void register(ConnectRestExtensionContext restPluginContext);
+
+    /**
+     * Configuration specification for this rest extension.
+     *
+     * @return the configuration definition for this rest extension; never null
+     */
+    @Override
+    default ConfigDef config() {
+        return new ConfigDef();
+    }
+
+    /**
+     * Get the version of this component.
+     *
+     * @return the version, formatted as a String. The version may not be {@code null} or empty.
+     */
+    @Override
+    default String version() {
+        return "undefined";
+    }

Review Comment:
   You are right, I had an oversight.



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21330:
URL: https://github.com/apache/kafka/pull/21330#issuecomment-3802902338

   A label of 'needs-attention' was automatically added to this PR in order to raise the
   attention of the committers. Once this issue has been triaged, the `triage` label
   should be removed to prevent this automation from happening again.


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mfvitale (via GitHub)" <gi...@apache.org>.
mfvitale commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2925950662


##########
connect/runtime/src/test/resources/test-plugins/non-migrated/test/plugins/NonMigratedConverter.java:
##########
@@ -43,4 +43,9 @@ public byte[] fromConnectData(final String topic, final Schema schema, final Obj
   public SchemaAndValue toConnectData(final String topic, final byte[] value) {
     return null;
   }
+
+    @Override
+    public String version() {
+        return "1.0.0";
+    }

Review Comment:
   Not really, but it could be better to maintain since it shows good practice in specifying a version. WDYT?



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison commented on PR #21330:
URL: https://github.com/apache/kafka/pull/21330#issuecomment-4048974217

   > @mimaison Do you think we can target this for 4.3?
   
   Yes that's my goal. The deadline to merge KIPs is next week. I'll take another look tomorrow but assuming the CI passes, I think it should be good to go.


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2925192893


##########
connect/runtime/src/test/resources/test-plugins/read-version-from-resource-v1/test/plugins/ReadVersionFromResource.java:
##########
@@ -40,7 +40,7 @@
  * Exfiltrates data via {@link ReadVersionFromResource#fromConnectData(String, Schema, Object)}
  * and {@link ReadVersionFromResource#toConnectData(String, byte[])}.
  */
-public class ReadVersionFromResource implements Converter, Versioned {
+public class ReadVersionFromResource implements Converter {

Review Comment:
   Unused `import org.apache.kafka.connect.components.Versioned;`



##########
connect/runtime/src/test/resources/test-plugins/versioned-predicate/test/plugins/VersionedPredicate.java:
##########
@@ -30,7 +30,7 @@
  * Predicate to test multiverioning of plugins.
  * Any instance of the string PLACEHOLDER_FOR_VERSION will be replaced with the actual version during plugin compilation.
  */
-public class VersionedPredicate<R extends ConnectRecord<R>> implements Predicate<R>, Versioned {
+public class VersionedPredicate<R extends ConnectRecord<R>> implements Predicate<R> {

Review Comment:
   Unused `import org.apache.kafka.connect.components.Versioned;`



##########
connect/runtime/src/test/resources/test-plugins/versioned-transformation/test/plugins/VersionedTransformation.java:
##########
@@ -29,7 +29,7 @@
  * Transformation to test multiverioning of plugins.
  * Any instance of the string PLACEHOLDER_FOR_VERSION will be replaced with the actual version during plugin compilation.
  */
-public class VersionedTransformation<R extends ConnectRecord<R>> implements Transformation<R>, Versioned {
+public class VersionedTransformation<R extends ConnectRecord<R>> implements Transformation<R> {

Review Comment:
   Unused `import org.apache.kafka.connect.components.Versioned;`



##########
connect/runtime/src/test/resources/test-plugins/read-version-from-resource-v2/test/plugins/ReadVersionFromResource.java:
##########
@@ -40,7 +40,7 @@
  * Exfiltrates data via {@link ReadVersionFromResource#fromConnectData(String, Schema, Object)}
  * and {@link ReadVersionFromResource#toConnectData(String, byte[])}.
  */
-public class ReadVersionFromResource implements Converter, Versioned {
+public class ReadVersionFromResource implements Converter {

Review Comment:
   Unused `import org.apache.kafka.connect.components.Versioned;`



##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/PluginsTest.java:
##########
@@ -777,7 +771,7 @@ public String version() {
         }
     }
 
-    public static class TestInternalConverter extends JsonConverter implements Versioned {
+    public static class TestInternalConverter extends JsonConverter {

Review Comment:
   We dropped the `version()` override from `TestConverter` above. I think we can drop it here as well. WDYT?



##########
connect/runtime/src/test/resources/test-plugins/read-version-from-resource-v2/test/plugins/ReadVersionFromResource.java:
##########
@@ -40,7 +40,7 @@
  * Exfiltrates data via {@link ReadVersionFromResource#fromConnectData(String, Schema, Object)}
  * and {@link ReadVersionFromResource#toConnectData(String, byte[])}.
  */
-public class ReadVersionFromResource implements Converter, Versioned {
+public class ReadVersionFromResource implements Converter {

Review Comment:
   Same in other files below



##########
connect/runtime/src/test/resources/test-plugins/bad-packaging/test/plugins/NoDefaultConstructorOverridePolicy.java:
##########
@@ -50,4 +50,9 @@ public void configure(Map<String, ?> configs) {
     public List<ConfigValue> validate(ConnectorClientConfigRequest connectorClientConfigRequest) {
         return null;
     }
+
+    @Override
+    public String version() {
+        return "1.0.0";
+    }

Review Comment:
   Is this needed?



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21330:
URL: https://github.com/apache/kafka/pull/21330#issuecomment-3924544975

   A label of 'needs-attention' was automatically added to this PR in order to raise the
   attention of the committers. Once this issue has been triaged, the `triage` label
   should be removed to prevent this automation from happening again.


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mfvitale (via GitHub)" <gi...@apache.org>.
mfvitale commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2883265451


##########
connect/api/src/main/java/org/apache/kafka/connect/rest/ConnectRestExtension.java:
##########
@@ -60,4 +61,24 @@ public interface ConnectRestExtension extends Configurable, Versioned, Closeable
      *                          ConnectRestExtensionContext#configurable()}
      */
     void register(ConnectRestExtensionContext restPluginContext);
+
+    /**
+     * Configuration specification for this rest extension.
+     *
+     * @return the configuration definition for this rest extension; never null
+     */
+    @Override
+    default ConfigDef config() {
+        return new ConfigDef();
+    }
+
+    /**
+     * Get the version of this component.
+     *
+     * @return the version, formatted as a String. The version may not be {@code null} or empty.
+     */
+    @Override
+    default String version() {
+        return "undefined";
+    }

Review Comment:
   You are right, I had an oversight. I removed  with last commit. 



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2884349697


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/PluginsTest.java:
##########
@@ -727,6 +727,11 @@ public String version() {
     public static class TestHeaderConverter implements HeaderConverter {
         public Map<String, ?> configs;
 
+        @Override
+        public String version() {
+            return "test";
+        }
+

Review Comment:
   Do we need this?



##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/ConnectorConfigTest.java:
##########
@@ -410,7 +410,7 @@ public AbstractTestPredicate() { }
 
     }
 
-    public abstract static class AbstractTransformation<R extends ConnectRecord<R>> implements Transformation<R>, Versioned  {
+    public abstract static class AbstractTransformation<R extends ConnectRecord<R>> implements Transformation<R>  {

Review Comment:
   We can also remove `implements Version` in `AbstractTestPredicate` just above



##########
connect/api/src/main/java/org/apache/kafka/connect/components/ConnectPlugin.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.kafka.connect.components;
+
+import org.apache.kafka.common.config.ConfigDef;
+
+/**
+ * Interface for components that provide version and configuration specifications.
+ * This interface establishes a common contract for all Kafka Connect components
+ * that define a version and expose configurable properties, enabling uniform discovery and introspection
+ * of component configurations.
+ *
+ * <p>Components implementing this interface declare their version and configuration requirements
+ * through a {@link ConfigDef} object, which describes the configuration properties
+ * including their names, types, default values, validators, and documentation.
+ *
+ */
+public interface ConnectPlugin extends Versioned {
+
+    /**
+     * Returns the configuration specification for this component.
+     *
+     * <p>The returned {@link ConfigDef} object describes all configuration properties
+     * that this component accepts, including their types, default values, validators,
+     * importance levels, and documentation strings.
+     *
+     * @return the configuration definition for this component; never null
+     */
+    ConfigDef config();
+} 

Review Comment:
   Nit: Add a new line



##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/ConnectorConfigTest.java:
##########
@@ -410,7 +410,7 @@ public AbstractTestPredicate() { }
 
     }
 
-    public abstract static class AbstractTransformation<R extends ConnectRecord<R>> implements Transformation<R>, Versioned  {
+    public abstract static class AbstractTransformation<R extends ConnectRecord<R>> implements Transformation<R>  {

Review Comment:
   and `SimpleTransformation`



##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/ConnectorConfigTest.java:
##########
@@ -410,7 +410,7 @@ public AbstractTestPredicate() { }
 
     }
 
-    public abstract static class AbstractTransformation<R extends ConnectRecord<R>> implements Transformation<R>, Versioned  {
+    public abstract static class AbstractTransformation<R extends ConnectRecord<R>> implements Transformation<R>  {

Review Comment:
   and `AbstractKeyValueTransformation.Key` too



##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/ConnectorConfigTest.java:
##########
@@ -410,7 +410,7 @@ public AbstractTestPredicate() { }
 
     }
 
-    public abstract static class AbstractTransformation<R extends ConnectRecord<R>> implements Transformation<R>, Versioned  {
+    public abstract static class AbstractTransformation<R extends ConnectRecord<R>> implements Transformation<R>  {

Review Comment:
   We also have `HasDuplicateConfigTransformation` which still implements Versioned a bit below



##########
connect/api/src/main/java/org/apache/kafka/connect/components/package-info.java:
##########
@@ -15,6 +15,6 @@
  * limitations under the License.
  */
 /**
- * Provides common interfaces used to describe pluggable components.
+ * Provides common interfaces used to describe pluggable and configurable components.

Review Comment:
   Should we mention versioned as well?



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2895796231


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/PluginsTest.java:
##########
@@ -717,15 +717,15 @@ public byte[] fromConnectData(String topic, Schema schema, Object value) {
         public SchemaAndValue toConnectData(String topic, byte[] value) {
             return null;
         }
+    }

Review Comment:
   `TestConverter` still implements `Versioned`



##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/PluginsTest.java:
##########
@@ -727,6 +727,11 @@ public String version() {
     public static class TestHeaderConverter implements HeaderConverter {
         public Map<String, ?> configs;
 
+        @Override
+        public String version() {
+            return "test";
+        }
+

Review Comment:
   My comment still stands, do we need this `version()` method in `TestHeaderConverter`?



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2926049110


##########
connect/runtime/src/test/resources/test-plugins/non-migrated/test/plugins/NonMigratedConverter.java:
##########
@@ -43,4 +43,9 @@ public byte[] fromConnectData(final String topic, final Schema schema, final Obj
   public SchemaAndValue toConnectData(final String topic, final byte[] value) {
     return null;
   }
+
+    @Override
+    public String version() {
+        return "1.0.0";
+    }

Review Comment:
   Alright, let's keep them



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20079: Improve Connect configurable components discoverability [kafka]

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison commented on code in PR #21330:
URL: https://github.com/apache/kafka/pull/21330#discussion_r2925200920


##########
connect/runtime/src/test/resources/test-plugins/classpath-converter/org/apache/kafka/connect/converters/ByteArrayConverter.java:
##########
@@ -32,7 +32,7 @@
 import java.util.List;
 import java.util.Map;
 
-public class ByteArrayConverter implements Converter, HeaderConverter, Versioned {
+public class ByteArrayConverter implements Converter, HeaderConverter {

Review Comment:
   Unused `import org.apache.kafka.connect.components.Versioned;`



-- 
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: jira-unsubscribe@kafka.apache.org

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