Class EnvVarConfigProvider
java.lang.Object
org.apache.kafka.common.config.provider.EnvVarConfigProvider
- All Implemented Interfaces:
Closeable,AutoCloseable,ConfigProvider,Configurable
An implementation of
ConfigProvider based on environment variables. Keys correspond to the names of the environment variables, paths are currently not being used. Using an allowlist pattern ALLOWLIST_PATTERN_CONFIG that supports regular expressions, it is possible to limit access to specific environment variables. Default allowlist pattern is ".*".Field Summary
FieldsConstructor Summary
ConstructorsMethod Summary
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.common.config.provider.ConfigProvider
subscribe, unsubscribe, unsubscribeAll
Field Details
ALLOWLIST_PATTERN_CONFIG
- See Also:
ALLOWLIST_PATTERN_CONFIG_DOC
- See Also:
Constructor Details
EnvVarConfigProvider
public EnvVarConfigProvider()EnvVarConfigProvider
Method Details
configure
Description copied from interface:ConfigurableConfigure this class with the given key-value pairs- Specified by:
configurein interfaceConfigurable
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
get
Description copied from interface:ConfigProviderRetrieves the data at the given path.- Specified by:
getin interfaceConfigProvider- Parameters:
path- unused- Returns:
- returns environment variables as configuration
get
Description copied from interface:ConfigProviderRetrieves the data with the given keys at the given path.- Specified by:
getin interfaceConfigProvider- Parameters:
path- path, not used for environment variableskeys- the keys whose values will be retrieved.- Returns:
- the configuration data.