Skip to content

KafkaJSTopicMetadataNotLoadedMetadata

reference
1 min readUpdated

Kind: Interface

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

Part of: Microservices

KafkaJSTopicMetadataNotLoadedMetadata identifies a Kafka topic whose metadata has not yet been loaded by the KafkaJS integration. It is used as lightweight context for metadata-loading errors, retries, or diagnostic logging within the microservices Kafka transport layer.

Properties

PropertyType
topicstring

Diagram

mermaid
graph LR
  A[Kafka Client Operation] --> B{Topic metadata loaded?}
  B -->|Yes| C[Use topic metadata]
  B -->|No| D[KafkaJSTopicMetadataNotLoadedMetadata]
  D --> E[topic: string]
  D --> F[Error handling, retry, or logging]

Usage

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

function reportMissingTopicMetadata(
  metadata: KafkaJSTopicMetadataNotLoadedMetadata,
): void {
  console.warn(
    `Kafka metadata has not been loaded for topic: ${metadata.topic}`,
  );
}

const missingMetadata: KafkaJSTopicMetadataNotLoadedMetadata = {
  topic: 'orders.created',
};

reportMissingTopicMetadata(missingMetadata);

AI Coding Instructions

  • Provide a non-empty Kafka topic name through the required topic field.
  • Use this interface only for contexts where topic metadata is unavailable or not yet initialized.
  • Preserve the exact topic name used by Kafka; avoid transforming or normalizing it before logging or error reporting.
  • Integrate instances with KafkaJS metadata lookup, retry, and diagnostic error-handling paths.

Was this page helpful?

Download as PDF
KafkaJSTopicMetadataNotLoadedMetadata — NestJS head-to-head