@alexknips/nestjs-kafka-events
Version:
Lightweight, tested, straight-forward wrapper around KafkaJS and Confluent's Schema Registry.
13 lines (12 loc) • 440 B
TypeScript
export interface IKafkaEvent<V = Record<string, unknown>, K = Record<string, unknown>> {
event: V;
key: K;
arrival: Date;
}
export declare type KafkaEventHandlerFunction = (event: IKafkaEvent) => Promise<void>;
export declare type KafkaEventEmitterFunction = () => Promise<void>;
export declare type EmitKafkaEventPayload<V, K> = {
topic: string;
event: IKafkaEvent<V, K>['event'];
key: IKafkaEvent<V, K>['key'];
};