Skip to content

MqttActorSettings

Defined in: src/io/broker/MqttActor.ts:68

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 brokerUrl?: string

Defined in: src/io/broker/MqttActor.ts:70

Broker URL — mqtt://, mqtts://, ws://, wss://.


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 cleanSession?: boolean

Defined in: src/io/broker/MqttActor.ts:81

Clean-session flag. Default true.


readonly optional clientId?: string

Defined in: src/io/broker/MqttActor.ts:72

Stable client id. When omitted the broker assigns one.


readonly optional credentials?: MqttCredentials

Defined in: src/io/broker/MqttActor.ts:73


readonly optional defaultQos?: MqttQos

Defined in: src/io/broker/MqttActor.ts:75

Default QoS used by publish / subscribe when not overridden per call.


readonly optional keepAliveSec?: number

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

Keep-alive interval in seconds. Default 60.


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 protocolVersion?: 4 | 5

Defined in: src/io/broker/MqttActor.ts:92

MQTT protocol version negotiated with the broker. Default 4 (MQTT 3.1.1) for back-compat with every existing config; set to 5 to opt in to MQTT 5.0 features (user properties + reason codes — see MqttPublish.userProperties + MqttMessage.reasonCode). The peer-dep mqtt handles the wire negotiation; we only flip the flag.


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 subscriptions?: readonly MqttSubscription[]

Defined in: src/io/broker/MqttActor.ts:77

Initial subscriptions wired up immediately after connect.


readonly optional will?: object

Defined in: src/io/broker/MqttActor.ts:79

Last-will-and-testament published by the broker if the actor disconnects ungracefully.

readonly payload: string | Uint8Array<ArrayBufferLike>

readonly optional qos?: MqttQos

readonly optional retain?: boolean

readonly topic: string