Skip to content

ConfigSynonyms

reference
1 min readUpdated

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

PropertyType
configNamestring
configValuestring
configSourceConfigSource

Diagram

mermaid
graph 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

ts
import { 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 configName and configValue as strings, even when the configuration value represents a number or boolean.
  • Always provide a valid ConfigSource enum 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 configValue is parsed or normalized; convert it explicitly before performing numeric or boolean operations.

Was this page helpful?

Download as PDF
ConfigSynonyms — NestJS head-to-head