Description
Currently, the Connect plugin discovery mechanisms only assert that a no-args constructor is present when necessary. In particular, this assertion happens for Connectors when the framework needs to evaluate the connector's version method.
It also happens for ConnectorConfigOverridePolicy, ConnectRestExtension, and ConfigProvider plugins, which are loaded via the ServiceLoader. The ServiceLoader constructs instances of plugins with their no-args constructor during discovery, so these plugins are discovered even if they are not Versioned.
This has the effect that these unusable plugins which are missing a default constructor appear in the REST API, but are not able to be instantiated or used. To make the ServiceLoader and Reflections discovery mechanisms behave more similar, this assertion should be applied to all plugins, and a log message emitted when plugins do not follow the constructor requirements.
Attachments
Issue Links
- Discovered while testing
-
KAFKA-14627 Modernize Connect plugin discovery
-
- Resolved
-
- is related to
-
KAFKA-15291 Implement Versioned interfaces in common Connect plugins
-
- Resolved
-
- requires
-
KAFKA-14654 Connectors have incorrect Thread Context Classloader during initialization
-
- Resolved
-
- links to