Skip to content

IResourceConfigEntry

reference
1 min readUpdated

Kind: Interface

Source: packages/microservices/external/kafka.interface.ts

Part of: Microservices

IResourceConfigEntry represents a single Kafka resource configuration property as a name/value pair. It is used when defining or reading resource-level settings, such as topic, broker, or consumer configuration entries.

Properties

PropertyType
namestring
valuestring

Diagram

mermaid
graph LR
  Config[IResourceConfigEntry] --> Name[name: string]
  Config --> Value[value: string]
  Config --> Kafka[Kafka resource configuration]

Usage

ts
import type { IResourceConfigEntry } from './kafka.interface';

const topicConfig: IResourceConfigEntry = {
  name: 'retention.ms',
  value: '604800000',
};

// Example: include the entry in a Kafka topic configuration request
const resourceConfig: IResourceConfigEntry[] = [
  topicConfig,
  {
    name: 'cleanup.policy',
    value: 'delete',
  },
];

AI Coding Instructions

  • Use name for the exact Kafka configuration key, such as retention.ms or cleanup.policy.
  • Store configuration values as strings, even when the underlying Kafka setting represents a number or boolean.
  • Prefer typed IResourceConfigEntry[] collections when passing multiple resource settings to Kafka administration APIs.
  • Do not add extra fields to configuration entries; consumers expect only name and value.
  • Validate Kafka-specific configuration names and allowed values before submitting changes to a broker or topic.

Was this page helpful?

Download as PDF
IResourceConfigEntry — NestJS head-to-head