@dugongjs/kafkajs
Version:
14 lines (13 loc) • 829 B
TypeScript
import type { IInboundMessageMapper, SerializedDomainEvent } from "@dugongjs/core";
import type { EachMessagePayload } from "kafkajs";
/**
* InboundMessageMapperKafkaJs is an implementation of the IInboundMessageMapper interface that maps KafkaJs EachMessagePayload to a SerializedDomainEvent.
*/
export declare class InboundMessageMapperKafkaJs implements IInboundMessageMapper<EachMessagePayload> {
/**
* Maps a KafkaJs EachMessagePayload to a SerializedDomainEvent by extracting the necessary fields from the message headers and value.
* @param messagePayload The EachMessagePayload received from KafkaJs, containing the message and its metadata.
* @returns A SerializedDomainEvent object constructed from the message payload.
*/
map(messagePayload: EachMessagePayload): SerializedDomainEvent;
}