Class MqttDeviceOptions

Namespace
ProtoTest.Devices.Mqtt
Assembly
ProtoTest.Devices.Mqtt.dll

How the MQTT transport reaches its broker and moves frames. Code sets defaults through AddMqttClient(..., configure); ProtoTest:Devices:Mqtt overrides them per environment.

public sealed class MqttDeviceOptions : IProtoConfigurableOptions
Inheritance
MqttDeviceOptions
Implements
Inherited Members
Extension Methods

Fields

BrokerSetting

The key a broker container or a configured environment fills with the broker address; a client registered without an address resolves through it.

public const string BrokerSetting = "ProtoTest:Devices:Mqtt:Broker"

Field Value

string

ConfigurationSectionName

The configuration section this type binds from.

public const string ConfigurationSectionName = "ProtoTest:Devices:Mqtt"

Field Value

string

Properties

Broker

Gets or sets the broker address (mqtt://host:port) a client registered without a resolver falls back to. The configuration or a started piece that publishes BrokerSetting wins over it, an address passed to AddMqttClient is used only after it, and a registered resolver replaces the whole precedence.

public string? Broker { get; set; }

Property Value

string

ConnectTimeout

Gets or sets how long a connection attempt may take. Defaults to 10 seconds.

public TimeSpan ConnectTimeout { get; set; }

Property Value

TimeSpan

KeepAlivePeriod

Gets or sets the keep-alive interval sent to the broker; null leaves the library default.

public TimeSpan? KeepAlivePeriod { get; set; }

Property Value

TimeSpan?

MaxPacketBytes

Gets or sets the largest MQTT packet the client accepts, offered to the broker as MQTT 5 MaximumPacketSize. Defaults to 4 MiB; set to zero to read without a cap.

public long MaxPacketBytes { get; set; }

Property Value

long

Methods

Validate()

Validates the resolved options once, after code callbacks and configuration have been applied. A bad value is a configuration error and must throw here rather than fail the first test that happens to use it. The default does nothing.

public void Validate()