Kind: Interface
Source: packages/microservices/external/kafka.interface.ts
Part of: Microservices
KafkaJSDeleteTopicRecordsErrorTopic describes delete-record failures for a single Kafka topic. It groups the topic name with partition-level error details, allowing callers to identify which partitions could not be truncated during a KafkaJS delete-records operation.
Properties
| Property | Type |
|---|---|
topic | string |
partitions | KafkaJSDeleteTopicRecordsErrorPartition[] |
Diagram
mermaidgraph LR A[KafkaJS deleteRecords response] --> B[KafkaJSDeleteTopicRecordsErrorTopic] B --> C[topic: string] B --> D[partitions: KafkaJSDeleteTopicRecordsErrorPartition[]] D --> E[Partition-specific error details]
Usage
tsimport type {
KafkaJSDeleteTopicRecordsErrorTopic,
} from './kafka.interface';
const topicError: KafkaJSDeleteTopicRecordsErrorTopic = {
topic: 'user-events',
partitions: [
{
partition: 0,
error: new Error('Offset is out of range'),
},
],
};
console.error(
`Failed to delete records for topic "${topicError.topic}"`,
topicError.partitions,
);
AI Coding Instructions
- Use this interface when representing delete-record errors grouped by Kafka topic.
- Always provide the exact Kafka topic name in
topic; do not use a wildcard or consumer-group name. - Populate
partitionswith partition-level error objects so failures can be retried or logged precisely. - Handle partial failures: one partition may fail while other partitions in the same topic succeed.
- Keep this type aligned with the KafkaJS delete-records response structure and its partition error type.
Was this page helpful?