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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
Configure this class with the given key-value pairsRetrieves the data at the given path.Retrieves the data with the given keys at the given path.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:Configurable
Configure this class with the given key-value pairs- Specified by:
configure
in interfaceConfigurable
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
get
Description copied from interface:ConfigProvider
Retrieves the data at the given path.- Specified by:
get
in interfaceConfigProvider
- Parameters:
path
- unused- Returns:
- returns environment variables as configuration
-
get
Description copied from interface:ConfigProvider
Retrieves the data with the given keys at the given path.- Specified by:
get
in interfaceConfigProvider
- Parameters:
path
- path, not used for environment variableskeys
- the keys whose values will be retrieved.- Returns:
- the configuration data.
-