UNPKG

@jucr/nestjs-kafka-events

Version:

Lightweight, tested, straight-forward wrapper around KafkaJS and Confluent's Schema Registry.

18 lines (17 loc) 729 B
import { KafkaLogger } from '../loggers'; import { IKafkaModuleSchemaRegistryConfiguration } from '../interfaces'; import { EmitKafkaEventPayload } from '../interfaces'; import { Message } from 'kafkajs'; export declare class KafkaAvroSerializer { private readonly kafkaLogger; private schemaRegistry; schemas: Map<string, { keyId: number | null; valueId: number; }>; constructor(kafkaLogger: KafkaLogger); initialize(configuration: IKafkaModuleSchemaRegistryConfiguration, topics: string[]): Promise<void>; private fetchAllSchemaIds; private fetchSchemaIds; serialize<V, K>(value: EmitKafkaEventPayload<V, K> & Omit<Message, 'key' | 'value'>): Promise<Message | undefined>; }