KafkaOptionsType
此内容尚不支持你的语言。
Defined in: src/io/broker/KafkaOptions.ts:14
Common options every broker actor accepts on top of its protocol-
specific options. Subclasses extend this interface with their own
required fields (e.g. brokerUrl, topics).
Extends
Section titled “Extends”Properties
Section titled “Properties”brokers?
Section titled “brokers?”
readonlyoptionalbrokers?:string| readonlystring[]
Defined in: src/io/broker/KafkaOptions.ts:16
Bootstrap servers ('kafka-1:9092,kafka-2:9092' or array).
circuitBreaker?
Section titled “circuitBreaker?”
readonlyoptionalcircuitBreaker?:object
Defined in: src/io/broker/BrokerOptions.ts:48
Optional circuit-breaker around connectImplementation. After
failureThreshold consecutive failed connect attempts the breaker
opens for resetMs and rejects new attempts immediately.
failureThreshold
Section titled “failureThreshold”
readonlyfailureThreshold:number
resetMs
Section titled “resetMs”
readonlyresetMs:number
Inherited from
Section titled “Inherited from”BrokerCommonOptionsType.circuitBreaker
clientId?
Section titled “clientId?”
readonlyoptionalclientId?:string
Defined in: src/io/broker/KafkaOptions.ts:18
Stable client id reported to the broker.
consumer?
Section titled “consumer?”
readonlyoptionalconsumer?:object
Defined in: src/io/broker/KafkaOptions.ts:33
Consumer options. groupId is required to start a consumer.
commitMode?
Section titled “commitMode?”
readonlyoptionalcommitMode?: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.
commitTimeoutMs?
Section titled “commitTimeoutMs?”
readonlyoptionalcommitTimeoutMs?: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.
fromBeginning?
Section titled “fromBeginning?”
readonlyoptionalfromBeginning?:boolean
groupId?
Section titled “groupId?”
readonlyoptionalgroupId?:string
outboundBuffer?
Section titled “outboundBuffer?”
readonlyoptionaloutboundBuffer?:number
Defined in: src/io/broker/BrokerOptions.ts:61
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).
Inherited from
Section titled “Inherited from”BrokerCommonOptionsType.outboundBuffer
producer?
Section titled “producer?”
readonlyoptionalproducer?:object
Defined in: src/io/broker/KafkaOptions.ts:28
Producer options.
allowAutoTopicCreation?
Section titled “allowAutoTopicCreation?”
readonlyoptionalallowAutoTopicCreation?:boolean
idempotent?
Section titled “idempotent?”
readonlyoptionalidempotent?:boolean
reconnect?
Section titled “reconnect?”
readonlyoptionalreconnect?:false| {factor?:number;initialDelayMs?:number;maxAttempts?:number;maxDelayMs?:number; }
Defined in: src/io/broker/BrokerOptions.ts:35
Reconnect strategy applied when the underlying connection drops or
connectImplementation throws. Default: exponential backoff starting at
200ms, doubling, capped at 30s, infinite attempts. Set to
false to disable auto-reconnect (one-shot connections).
Union Members
Section titled “Union Members”false
Type Literal
Section titled “Type Literal”{ factor?: number; initialDelayMs?: number; maxAttempts?: number; maxDelayMs?: number; }
factor?
Section titled “factor?”
readonlyoptionalfactor?:number
initialDelayMs?
Section titled “initialDelayMs?”
readonlyoptionalinitialDelayMs?:number
maxAttempts?
Section titled “maxAttempts?”
readonlyoptionalmaxAttempts?:number
Cap on retry attempts. Default: Infinity (retry forever).
maxDelayMs?
Section titled “maxDelayMs?”
readonlyoptionalmaxDelayMs?:number
Inherited from
Section titled “Inherited from”BrokerCommonOptionsType.reconnect
readonlyoptionalsasl?:object
Defined in: src/io/broker/KafkaOptions.ts:20
Optional SASL credentials.
mechanism
Section titled “mechanism”
readonlymechanism:"plain"|"scram-sha-256"|"scram-sha-512"
password
Section titled “password”
readonlypassword:string
username
Section titled “username”
readonlyusername:string
readonlyoptionalssl?:boolean
Defined in: src/io/broker/KafkaOptions.ts:26
Enable TLS.
target?
Section titled “target?”
readonlyoptionaltarget?:ActorRef<KafkaRecord>
Defined in: src/io/broker/KafkaOptions.ts:52
Subscriber that receives every consumed record.
topics?
Section titled “topics?”
readonlyoptionaltopics?: readonlystring[]
Defined in: src/io/broker/KafkaOptions.ts:54
Topics the consumer subscribes to at connect time.
