Skip to main content

config_from_file

Function config_from_file 

Source
pub fn config_from_file(
    path: impl AsRef<Path>,
) -> KafkaConfigResult<HashMap<String, String>>
Expand description

Load librdkafka configuration from a file in the config git directory.

Detects format from file extension:

ExtensionFormatRequires
.propertiesJava-style key=valuenothing (always available)
.yaml, .ymlYAML flat mappingdirectory-config feature
.jsonJSON objectconfig feature

The returned map passes directly to merge_with_overrides or as librdkafka_overrides in KafkaConfig.

ยงErrors

Returns KafkaConfigError if the file is missing, the format is unsupported, or parsing fails.