Aller au contenu
Français

MqttOptionsType

Ce contenu n’est pas encore disponible dans votre langue.

Defined in: src/io/broker/MqttOptions.ts:39

Plain options-object shape accepted by an MqttActor.

readonly optional brokerUrl?: string

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

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


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

Defined in: src/io/broker/MqttOptions.ts:50

Clean-session flag. Default true.


readonly optional clientId?: string

Defined in: src/io/broker/MqttOptions.ts:43

Stable client id. When omitted the broker assigns one.


readonly optional codec?: MqttCodec<unknown>

Defined in: src/io/broker/MqttOptions.ts:65

Payload codec used by MqttPayload.entity (inbound decode) and by publish when handed a non-string/non-Uint8Array entity. Default: mqttJsonCodec. One codec per actor.


readonly optional credentials?: MqttCredentials

Defined in: src/io/broker/MqttOptions.ts:44


readonly optional keepAlive?: number

Defined in: src/io/broker/MqttOptions.ts:52

Keep-alive interval in seconds. Default 60.


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

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

MQTT protocol version negotiated with the broker. Default 4 (MQTT 3.1.1); set to 5 to opt in to MQTT 5.0 features (user properties + reason codes — see MqttPublish.userProperties


readonly optional qos?: MqttQos

Defined in: src/io/broker/MqttOptions.ts:46

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


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 will?: object

Defined in: src/io/broker/MqttOptions.ts:48

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