Class MqttConnectionFactory
Named connection factory for MQTT. Register it in the route registry and reference it by name
from the endpoint URI (connectionFactory=my-broker) so broker credentials never have to
appear in the URI, and therefore can never reach logs, telemetry, or the Tsak dashboard.
Example:
context.AddToRegistry("iot-broker", new MqttConnectionFactory
{
Server = "mqtt.corp.local",
Port = 8883,
UseTls = true,
Username = "svc-ingest",
Password = Environment.GetEnvironmentVariable("MQTT_PASSWORD")
});
// route carries no credentials at all:
r.From("mqtt://sensors/+/temp?connectionFactory=iot-broker")
public sealed class MqttConnectionFactory
Inheritance
Properties
SessionExpiryInterval
MQTT 5 Session Expiry Interval in seconds (default 0: the session ends with the connection).
public int SessionExpiryInterval { get; set; }