Current state: Accepted

Discussion thread: here

JIRA: KAFKA-14376 - Getting issue details... STATUS

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).


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:




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
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: was already added to

Compatibility, Deprecation, and Migration Plan

No compatibility issues as this will add a new separate functionality and configuration options.

Test Plan

No breakages expected. Integration testing with a client (producer/consumer) along with unit testing should be sufficient.

Rejected Alternatives

No currently known alternatives with a provider. One existing workaround that some implementations use are templates for configs and scripts to replace environment variables.

  • No labels