Skip to content

Options

Every options type, every property, every default.

PulseMqttClientOptions (dependency injection)

Bindable from configuration; one instance per client name.

PropertyDefaultMeaning
Host— (required)Broker host name or IP
Port1883Broker port (conventionally 8883 for TLS)
UseTlsfalseTLS for the default TCP transport
ClientId— (required)MQTT client identifier
KeepAliveSeconds60Keep-alive interval; 0 disables
CleanStarttrueStart a clean session
Username / PasswordnullBroker credentials
ProtocolVersionV500V500 or V311
ConnectWithHosttruefalse hands connect/disconnect to the application

V311 keeps the MQTT 3.1.1 wire contract: no MQTT 5 properties, no response-topic based request/response helpers, no enhanced authentication, no re-authentication, and no topic aliases.

ResilientMqttClientOptions

For direct construction; with DI these come from PulseMqttClientOptions plus builder swaps.

PropertyDefaultMeaning
Connect— (required)The CONNECT packet template used for every (re)connection
Rawnew()Per-connection settings (below)
OfflineQueuenew()Offline queue bounds and policy (below)
Backoffnew()Default backoff bounds; ignored when ReconnectStrategy is set
FollowServerRedirectsfalseFollow MQTT 5 UseAnotherServer/ServerMoved redirects instead of faulting (resilience)
MaxServerRedirects8Rapid redirect hops allowed before the next redirect is terminal
ReconnectStrategybackoff + jitterThe reconnect loop (swap)
ReconnectDecisionauth-finalRetry-or-fault classification (swap)
Lifecyclere-subscriberConnection up/down hooks (swap)
SessionStorein-memoryDurable subscription set (swap)
MessageStorebounded in-memoryOffline publish queue (swap)
SerializernullTyped messaging; typed APIs throw until set
Loggernull (silent)Structured log sink
WillnullLast-will message registered with every CONNECT (presence)
WillProvidernullComputes the will fresh per connection attempt with context; wins over WillFactory, Will, and Connect.Will
WillFactorynullComputes the will fresh per connection attempt; wins over Will when no provider is set
BirthnullMessage published automatically on every connection-up
BirthFactorynullComputes the birth per connection-up (sees the attempt counter); wins over Birth
BirthFailureFailConnectionFailConnection or LogAndContinue when the birth publish fails

RawMqttClientOptions

PropertyDefaultMeaning
Connectionnew()Engine settings (below)
ConnAckTimeout30 sHandshake wait for the CONNACK
PingResponseTimeout30 sPINGRESP wait before faulting
AcknowledgementTimeout30 sPublish/subscribe/unsubscribe acknowledgement wait
InboundMessageCapacity256Bound of the received-message queue
UseOutboundTopicAliasesfalseCompress repeated publish topics into MQTT 5 aliases, within the broker's maximum
AuthenticatornullMQTT 5 enhanced-authentication handler (connecting)

MqttConnectionOptions

PropertyDefaultMeaning
ProtocolVersionV500Decode rules for inbound packets
InboundQueueCapacityboundedCapacity of the packet engine's inbound channel
MaxInboundPacketSizeboundedHard limit on a single inbound packet

OfflineQueueOptions

PropertyDefaultMeaning
Capacity1024Maximum queued publishes
OverflowBlockBlock | DropOldest | DropNewest | Reject
IncludeQos0falseQueue QoS 0 publishes instead of dropping them
PublishWaitTimeoutnullBlock wait bound before OfflineQueueFullException; null = indefinite

BackoffOptions

PropertyDefaultMeaning
BaseDelay500 msFirst retry delay; doubles per attempt (with full jitter)
MaxDelay30 sCap on the exponential growth
MaxAttemptsnullAttempt limit; null retries indefinitely

MqttRouteOptions

PropertyDefaultMeaning
Capacity64Bound of the route's queue
OverflowWaitWait | DropOldest | DropNewest
MaxConcurrency1Concurrent handler invocations; 1 preserves order

Broker subscription options live on MqttTopicFilter; for route templates, create one with MqttRouteTemplate.ToTopicFilter(...).

MqttRequestOptions

PropertyDefaultMeaning
Timeout30 sReply wait before MqttException
QualityOfServiceAtLeastOnceQoS of the request publish

TcpTransportOptions

PropertyDefaultMeaning
Host / PortEndpoint
UseTlsfalseWrap in TLS
TlsTargetHostnullSNI override when it differs from Host
ClientCertificatesnullMutual TLS
ServerCertificateValidationplatform defaultCustom validation callback

WebSocketTransportOptions

PropertyDefaultMeaning
Uri— (required)ws:// or wss:// endpoint
SubProtocol"mqtt"Negotiated subprotocol
ConfigureClientnullHeaders, proxy, certificates on the underlying client

Released under the MIT License.