Kafka message broker implementation.
Creates a new Kafka broker.
serializer: ISerializer
Serializer for message payloads
options: KafkaOptions
Kafka connection and configuration options
connect(): Promise<void>
Connects to Kafka and creates producer.
disconnect(): Promise<void>
Disconnects from Kafka.
isHealthy(): Promise<boolean>
Boolean port member (M70c): false only when positively unreachable.
isReady(): boolean
Checks if the broker is connected.
publish<T>(topic: string,message: T): Promise<void>
Publishes a message to a topic.
publishWithHeaders<T>(topic: string,message: T,headers: Readonly<Record<string, string>>): Promise<void>
Publishes a message with framework-owned transport headers. @internal
reachability(): Promise<boolean | undefined>
Tri-state backend reachability (M70c).
kafkajs retries internally, so the broker runs the supervisor in
observe mode: the producer's producer.disconnect/producer.connect
events (the VALUES of kafkajs's producer.events.DISCONNECT /
producer.events.CONNECT — the uppercase KEYS are not accepted listener
names and kafkajs throws for them, X28-1) mark the fault window
(consumer.crash with restart: false is terminal and surfaces as a
producer.disconnect the client does not recover from). false while the
window is active, true otherwise, undefined when the producer exposes
no event surface (a minimal fake) — the indicator then reports
reachable: 'unknown'.
request<TReq, TRes>(): Promise<TRes>
Sends a request and awaits its single correlated reply.
Replies arrive on the shared reply topic (KafkaOptions.replyTopic,
default 'messaging.replies'), which must exist — this broker creates
no topics, because IKafkaFactory exposes no admin surface. Either
pre-create it or enable auto.create.topics.enable; otherwise the
underlying producer error surfaces from this call rather than hanging until
the timeout.
requestWithHeaders<TReq, TRes>(): Promise<TRes>
Sends request-reply traffic with framework-owned headers. @internal
respond<TReq, TRes>(): Promise<ISubscription>
Registers a responder for a request topic. The handler's resolved value is sent back to the caller, correlated to the originating request.
subscribe<T>(): Promise<ISubscription>
Subscribes to a topic using a consumer group.
subscribeWithHeaders<T>(): Promise<ISubscription>
Subscribes through the header-aware internal path. @internal