Skip to content

ResourceConfigQuery

reference
1 min readUpdated

Kind: Interface

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

Part of: Microservices

ResourceConfigQuery defines a request for retrieving configuration values from a Kafka resource. It identifies the Kafka resource type and name, then specifies which configuration keys should be returned.

Properties

PropertyType
typeConfigResourceTypes
namestring
configNamesstring[]

Diagram

mermaid
graph LR
  Query[ResourceConfigQuery] --> Type[type: ConfigResourceTypes]
  Query --> Name[name: string]
  Query --> ConfigNames[configNames: string[]]

  Type --> Resource[Kafka resource type]
  Name --> Target[Target resource name]
  ConfigNames --> Keys[Requested configuration keys]

Usage

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

const topicConfigQuery: ResourceConfigQuery = {
  type: ConfigResourceTypes.TOPIC,
  name: 'orders.created',
  configNames: [
    'retention.ms',
    'cleanup.policy',
    'min.insync.replicas',
  ],
};

// Pass the query to the Kafka admin/configuration service.
const configs = await kafkaConfigService.describeResourceConfig(topicConfigQuery);

AI Coding Instructions

  • Set type to the matching ConfigResourceTypes value for the target Kafka resource, such as a topic or broker.
  • Provide the exact Kafka resource identifier in name; topic names and broker identifiers must match the cluster configuration.
  • Include only the configuration keys needed in configNames to avoid unnecessary admin API requests.
  • Keep this interface aligned with the Kafka admin client integration that resolves resource configurations.
  • Validate or handle missing configuration keys when consuming the returned configuration response.

How it works

ResourceConfigQuery is an exported TypeScript interface in a file declared to represent KafkaJS package types only; it contains no executable implementation. packages/microservices/external/kafka.interface.ts:1-8 packages/microservices/external/kafka.interface.ts:343-347

Was this page helpful?

Download as PDF
ResourceConfigQuery — NestJS head-to-head