Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Rename configuration, add background links, change ONLY_SCAN behavior

...

This change will require connector developers to add service declarations to their plugins. This can be done in one of two ways:

  • Add one or more ServiceLoader manifest files.
  • Add a module-info.java  containing one or more provides … with  directives.
    • See Section 7.7.4 of the Java Language Specification 9 for details
    • Connectors using module-info files without also providing a ServiceLoader manifest will not be accessible in Java 8 environments.

Both of these are well-established Java interfaces for which public documentation should be readily available. Once a service declaration is added, plugins can be released and distributed normally.

...

The Connect Worker will have a new configuration: plugin.path.discovery  which can take one of multiple values with the following meanings:

  • ONLY_SCAN  : Corresponding to the legacy behavior, in which every class on the plugin.path is scanned on startup for plugins. In addition, a warning will be printed to suggest reconfiguring the worker to HYBRID_WARN. This is intended to silence warnings, and to disable the new code paths if a bug is present.
  • HYBRID_WARN : In addition to the legacy scanning behavior, use the new mechanism and print a warning if a class is present via scanning but not via ServiceLoader. If there are no discrepancies, a warning will be printed to suggest reconfiguring the worker with SERVICE_LOAD . This is intended to inform operators that they are depending on out-of-date plugins that need to be updated.
  • HYBRID_FAIL : Same as HYBRID_WARN , except a discrepancy between the old and new mechanisms will cause a worker to fail to start up, instead of appearing at runtime as a missing plugin. This is intended for use in downstream unit and packaging tests to assert that all plugins have been updated.
  • SERVICE_LOAD : Only use the new ServiceLoader mechanism to load plugins. This is intended for production usage after all plugins have been updated, and will be the only mode with performance benefits.

...