Class KafkaInAsync<INTERNALIN, INTERNALRETURN, INTERNALOUT, EXTERNALOUT>Abstract

Represents an asynchronous Kafka route with specific input and output types.


import { KafkaInAsync } from '@modules/starter';
import { FastifyInstance } from 'fastify';

export class MyKafkaRoute extends KafkaInAsync<string, string, string, string> {
ID = 'MyKafkaRoute';
TYPE = ROUTETYPE.KAFKA;
topic = 'my-topic';
outTopic = 'my-out-topic';

Type Parameters

  • INTERNALIN

    The type of the input data consumed by the route.

  • INTERNALRETURN

    The type of the data returned by the consume function.

  • INTERNALOUT

    The type of the data processed by the process function.

  • EXTERNALOUT

    The type of the data produced by the produce function.

Implements

Constructors

Properties

DESCRIPTION?: string

A description of the route.

ID: string

The unique identifier for the route.

outTopic: string

The Kafka topic to produce messages to.

topic: string

The Kafka topic to consume messages from.

TYPE: ROUTETYPE

The type of the route, defined by the ROUTETYPE enum.

Methods

  • Initializes the route.

    Parameters

    • app: FastifyInstance<
          RawServerDefault,
          IncomingMessage,
          ServerResponse<IncomingMessage>,
          FastifyBaseLogger,
          FastifyTypeProviderDefault,
      >

    Returns Promise<void>