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
| Property | Type |
|---|---|
name | string |
value | string |
Diagram
mermaidgraph LR Config[IResourceConfigEntry] --> Name[name: string] Config --> Value[value: string] Config --> Kafka[Kafka resource configuration]
Usage
tsimport 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
namefor the exact Kafka configuration key, such asretention.msorcleanup.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
nameandvalue. - Validate Kafka-specific configuration names and allowed values before submitting changes to a broker or topic.
Was this page helpful?