Skip to content
English

TcpServerOptionsType

Defined in: src/io/broker/TcpServerOptions.ts:19

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).

readonly optional bindHost?: string

Defined in: src/io/broker/TcpServerOptions.ts:21

Local bind address. Default: '0.0.0.0'.


readonly optional bindPort?: number

Defined in: src/io/broker/TcpServerOptions.ts:23

Local port. Required; 0 lets the OS pick (read back via boundPort).


readonly optional circuitBreaker?: 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.

readonly failureThreshold: number

readonly resetMs: number

BrokerCommonOptionsType.circuitBreaker


readonly optional framing?: TcpFraming

Defined in: src/io/broker/TcpServerOptions.ts:25

Frame extraction, applied per accepted connection. Default { kind: 'bytes' }.


readonly optional maxConnections?: number

Defined in: src/io/broker/TcpServerOptions.ts:42

Admission cap on simultaneously accepted connections. A connection arriving at the cap is closed immediately instead of being registered. Default: Infinity (unlimited).


readonly optional outboundBuffer?: 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).

BrokerCommonOptionsType.outboundBuffer


readonly optional reconnect?: 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).

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

BrokerCommonOptionsType.reconnect


readonly optional target?: ActorRef<TcpServerMessage>

Defined in: src/io/broker/TcpServerOptions.ts:27

Subscriber for every connection event and inbound frame. Required.


readonly optional tls?: TlsTransportOptionsType

Defined in: src/io/broker/TcpServerOptions.ts:36

Serve TLS instead of plaintext. Carries the certificate material, never a path to it — see TlsTransportOptionsType. Deliberately has no HOCON leaf: a config file is the wrong place for a private key.

Supplying ca turns on client-certificate verification (mTLS) unless requestClientCert: false says otherwise.