Table of Contents |
---|
Status
Current state: Under Discussion Accepted
Discussion thread: here
JIRA: Jira server ASF JIRA columnIds issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution columns key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution serverId 5aa69414-a9e9-3523-82ec-879b028fb15b key KAFKA-14376
...
So far it is not possible to inject additional configurations stored in environment variables. This topic came up in several projects and would be a useful feature to have as a Kafka config feature similar to file/directory providers, example configuration:
config.providers=env
config.providers.env.class=org.apache.kafka.common.config.provider.EnvVarConfigProvider
ssl.key.password=${env
...
:KEY_PASSPHRASE}
Public Interfaces
A new implementation of the interface org.apache.kafka.common.config.provider.ConfigProvider will be added.
Affected components:
org/apache/kafka/common
The provider will expose a configuration to restrict the environment variables accessing by the provider.
Name: allowlist.pattern
Type: String
Documentation: A pattern / regular expression that needs to match for environment variables to be used by this config provider
Default: .*
Proposed Changes
A class EnvVarConfigProvider implementing the ConfigProvider interface will be added. Core functionality is to provide the map returned by System.getEnv() via the get methods of the ConfigProvider.
Example implementation: https://github.com/Schm1tz1/kafka-config-provider-env-var was already added to https://github.com/Schm1tz1/kafka/tree/kip-887
Compatibility, Deprecation, and Migration Plan
...