Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ServerKafka

Hierarchy

Implements

Index

Constructors

constructor

  • new ServerKafka(options: KafkaOptions["options"]): ServerKafka

Properties

Protected brokers

brokers: string[] | BrokersFunction

Protected client

client: Kafka = null

Protected clientId

clientId: string

Protected consumer

consumer: Consumer = null

Protected deserializer

deserializer: ConsumerDeserializer

Protected groupId

groupId: string

Protected logger

logger: Logger = new Logger(ServerKafka.name)

Protected Readonly messageHandlers

messageHandlers: Map<string, MessageHandler<any, any, any>> = new Map<string, MessageHandler>()

Protected Readonly options

options: KafkaOptions["options"]

Protected producer

producer: Producer = null

Protected serializer

serializer: ConsumerSerializer

Readonly transportId

transportId: KAFKA = Transport.KAFKA

Methods

addHandler

  • addHandler(pattern: any, callback: MessageHandler, isEventHandler?: boolean): void

assignCorrelationIdHeader

  • assignCorrelationIdHeader(correlationId: string, outgoingMessage: Message): void

assignErrorHeader

  • assignErrorHeader(outgoingResponse: OutgoingResponse, outgoingMessage: Message): void

assignIsDisposedHeader

  • assignIsDisposedHeader(outgoingResponse: OutgoingResponse, outgoingMessage: Message): void

assignReplyPartition

  • assignReplyPartition(replyPartition: string, outgoingMessage: Message): void

bindEvents

  • bindEvents(consumer: Consumer): Promise<void>

close

  • close(): void

createClient

  • createClient<T>(): T

getHandlerByPattern

getHandlers

getMessageHandler

  • getMessageHandler(): (Anonymous function)

getOptionsProp

  • getOptionsProp<T, K>(obj: T, prop: K, defaultValue?: T[K]): T[K]

getPublisher

  • getPublisher(replyTopic: string, replyPartition: string, correlationId: string): (data: any) => any

Protected getRouteFromPattern

  • getRouteFromPattern(pattern: string): string

Protected handleError

  • handleError(error: string): void

handleEvent

handleMessage

  • handleMessage(payload: EachMessagePayload): Promise<any>

Protected initializeDeserializer

  • initializeDeserializer(options: ClientOptions["options"]): void

Protected initializeSerializer

  • initializeSerializer(options: KafkaOptions["options"]): void

listen

  • listen(callback: () => void): Promise<void>

Protected loadPackage

  • loadPackage<T>(name: string, ctx: string, loader?: Function): T

Protected normalizePattern

  • normalizePattern(pattern: MsPattern): string

send

  • send(stream$: Observable<any>, respond: (data: WritePacket) => void): Subscription

sendMessage

  • sendMessage(message: OutgoingResponse, replyTopic: string, replyPartition: string, correlationId: string): void

start

  • start(callback: () => void): Promise<void>

transformToObservable

  • transformToObservable<T>(resultOrDeferred: any): Observable<T>

Generated using TypeDoc