Greg Harris created KAFKA-14863:
-----------------------------------
Summary: Plugins which do not have a valid no-args constructor are
visible in the REST API
Key: KAFKA-14863
URL: https://issues.apache.org/jira/browse/KAFKA-14863
Project: Kafka
Issue Type: Bug
Components: KafkaConnect
Reporter: Greg Harris
Assignee: Greg Harris
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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)