Skip to content

KafkaActorSettings

Defined in: src/io/broker/KafkaActor.ts:45

Common settings every broker actor accepts on top of its protocol- specific options. Subclasses extend this interface with their own required fields (e.g. brokerUrl, topics).

readonly optional brokers?: string | readonly string[]

Defined in: src/io/broker/KafkaActor.ts:47

Bootstrap servers ('kafka-1:9092,kafka-2:9092' or array).


readonly optional circuitBreaker?: object

Defined in: src/io/broker/BrokerSettings.ts:28

Optional circuit-breaker around connectImpl. After failureThreshold consecutive failed connect attempts the breaker opens for resetMs and rejects new attempts immediately.

readonly failureThreshold: number

readonly resetMs: number

BrokerCommonSettings.circuitBreaker


readonly optional clientId?: string

Defined in: src/io/broker/KafkaActor.ts:49

Stable client id reported to the broker.


readonly optional consumer?: object

Defined in: src/io/broker/KafkaActor.ts:64

Consumer settings. groupId is required to start a consumer.

readonly optional commitMode?: KafkaCommitMode

Offset-commit policy. Default 'auto' — kafkajs auto-commits after the handler returns (at-least-once). See KafkaCommitMode for the 'manual' (exactly-once-with- processing) shape.

readonly optional commitTimeoutMs?: number

Max time in ms the manual-commit pump waits for an external commit / nack before giving up on a message and letting kafkajs reject it (which triggers a rebalance and re-delivery). Only used when commitMode === 'manual'. Default 30s.

readonly optional fromBeginning?: boolean

readonly optional groupId?: string


readonly optional outboundBuffer?: number

Defined in: src/io/broker/BrokerSettings.ts:41

Maximum number of outbound messages buffered while the connection is connecting or disconnected. When the buffer is full the oldest message is dropped (FIFO eviction) and a BrokerBufferOverflow event is published. Default: 1000. Set to 0 to fail-fast (publish a BrokerNotConnected event and drop the message).

BrokerCommonSettings.outboundBuffer


readonly optional producer?: object

Defined in: src/io/broker/KafkaActor.ts:59

Producer settings.

readonly optional allowAutoTopicCreation?: boolean

readonly optional idempotent?: boolean


readonly optional reconnect?: false | { factor?: number; initialDelayMs?: number; maxAttempts?: number; maxDelayMs?: number; }

Defined in: src/io/broker/BrokerSettings.ts:15

Reconnect strategy applied when the underlying connection drops or connectImpl throws. Default: exponential backoff starting at 200ms, doubling, capped at 30s, infinite attempts. Set to false to disable auto-reconnect (one-shot connections).

false


{ factor?: number; initialDelayMs?: number; maxAttempts?: number; maxDelayMs?: number; }

readonly optional factor?: number

readonly optional initialDelayMs?: number

readonly optional maxAttempts?: number

Cap on retry attempts. Default: Infinity (retry forever).

readonly optional maxDelayMs?: number

BrokerCommonSettings.reconnect


readonly optional sasl?: object

Defined in: src/io/broker/KafkaActor.ts:51

Optional SASL credentials.

readonly mechanism: "plain" | "scram-sha-256" | "scram-sha-512"

readonly password: string

readonly username: string


readonly optional ssl?: boolean

Defined in: src/io/broker/KafkaActor.ts:57

Enable TLS.


readonly optional target?: ActorRef<KafkaRecord>

Defined in: src/io/broker/KafkaActor.ts:83

Subscriber that receives every consumed record.


readonly optional topics?: readonly string[]

Defined in: src/io/broker/KafkaActor.ts:85

Topics the consumer subscribes to at connect time.