Kind: Interface
Source: packages/microservices/external/kafka.interface.ts
Part of: Microservices
ConfigSynonyms represents a Kafka broker configuration entry together with its resolved value and origin. It is used when inspecting or describing Kafka configuration synonyms, allowing consumers to identify both the effective setting and the ConfigSource that supplied it.
Properties
| Property | Type |
|---|---|
configName | string |
configValue | string |
configSource | ConfigSource |
Diagram
mermaidgraph LR A[Kafka Configuration Response] --> B[ConfigSynonyms] B --> C[configName: string] B --> D[configValue: string] B --> E[configSource: ConfigSource] E --> F[Kafka Config Origin]
Usage
tsimport { ConfigSource, type ConfigSynonyms } from './kafka.interface';
const brokerConfig: ConfigSynonyms = {
configName: 'log.retention.hours',
configValue: '168',
configSource: ConfigSource.DEFAULT_CONFIG,
};
function describeConfig(config: ConfigSynonyms): string {
return `${config.configName}=${config.configValue} (${config.configSource})`;
}
console.log(describeConfig(brokerConfig));
AI Coding Instructions
- Preserve
configNameandconfigValueas strings, even when the configuration value represents a number or boolean. - Always provide a valid
ConfigSourceenum value to identify where Kafka resolved the setting from. - Use this interface when mapping Kafka Admin API configuration synonym responses into application-level types.
- Do not assume
configValueis parsed or normalized; convert it explicitly before performing numeric or boolean operations.
Was this page helpful?