[
https://issues.apache.org/jira/browse/KAFKA-13329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chris Egerton updated KAFKA-13329:
----------------------------------
Description:
Users may specify a key and/or value converter class for their connector
directly in the configuration for that connector. If this occurs, no preflight
validation is performed to ensure that the specified converter is valid.
Unfortunately, the [Converter
interface|https://github.com/apache/kafka/blob/4eb386f6e060e12e1940c0d780987e3a7c438d74/connect/api/src/main/java/org/apache/kafka/connect/storage/Converter.java]
does not require converters to expose a {{ConfigDef}} (unlike the
[HeaderConverter
interface|https://github.com/apache/kafka/blob/4eb386f6e060e12e1940c0d780987e3a7c438d74/connect/api/src/main/java/org/apache/kafka/connect/storage/HeaderConverter.java#L48-L52],
which does have that requirement), so it's unlikely that the configuration
properties of the converter itself can be validated.
However, we can and should still validate that the converter class exists, can
be instantiated (i.e., has a public, no-args constructor and is a concrete,
non-abstract class), and implements the {{Converter}} interface.
*EDIT:* Since this ticket was originally filed, a {{Converter::config}} method
was added in
[KIP-769|https://cwiki.apache.org/confluence/display/KAFKA/KIP-769%3A+Connect+APIs+to+list+all+connector+plugins+and+retrieve+their+configuration+definitions].
We can now utilize that config definition during preflight validation for
connectors.
was:
Users may specify a key and/or value converter class for their connector
directly in the configuration for that connector. If this occurs, no preflight
validation is performed to ensure that the specified converter is valid.
Unfortunately, the [Converter
interface|https://github.com/apache/kafka/blob/4eb386f6e060e12e1940c0d780987e3a7c438d74/connect/api/src/main/java/org/apache/kafka/connect/storage/Converter.java]
does not require converters to expose a {{ConfigDef}} (unlike the
[HeaderConverter
interface|https://github.com/apache/kafka/blob/4eb386f6e060e12e1940c0d780987e3a7c438d74/connect/api/src/main/java/org/apache/kafka/connect/storage/HeaderConverter.java#L48-L52],
which does have that requirement), so it's unlikely that the configuration
properties of the converter itself can be validated.
However, we can and should still validate that the converter class exists, can
be instantiated (i.e., has a public, no-args constructor and is a concrete,
non-abstract class), and implements the {{Converter}} interface.
> Connect does not perform preflight validation for per-connector key and value
> converters
> ----------------------------------------------------------------------------------------
>
> Key: KAFKA-13329
> URL: https://issues.apache.org/jira/browse/KAFKA-13329
> Project: Kafka
> Issue Type: Bug
> Components: KafkaConnect
> Reporter: Chris Egerton
> Assignee: Chris Egerton
> Priority: Major
>
> Users may specify a key and/or value converter class for their connector
> directly in the configuration for that connector. If this occurs, no
> preflight validation is performed to ensure that the specified converter is
> valid.
> Unfortunately, the [Converter
> interface|https://github.com/apache/kafka/blob/4eb386f6e060e12e1940c0d780987e3a7c438d74/connect/api/src/main/java/org/apache/kafka/connect/storage/Converter.java]
> does not require converters to expose a {{ConfigDef}} (unlike the
> [HeaderConverter
> interface|https://github.com/apache/kafka/blob/4eb386f6e060e12e1940c0d780987e3a7c438d74/connect/api/src/main/java/org/apache/kafka/connect/storage/HeaderConverter.java#L48-L52],
> which does have that requirement), so it's unlikely that the configuration
> properties of the converter itself can be validated.
> However, we can and should still validate that the converter class exists,
> can be instantiated (i.e., has a public, no-args constructor and is a
> concrete, non-abstract class), and implements the {{Converter}} interface.
> *EDIT:* Since this ticket was originally filed, a {{Converter::config}}
> method was added in
> [KIP-769|https://cwiki.apache.org/confluence/display/KAFKA/KIP-769%3A+Connect+APIs+to+list+all+connector+plugins+and+retrieve+their+configuration+definitions].
> We can now utilize that config definition during preflight validation for
> connectors.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)