Path: redb-route/redb.Route.MqttNet/Connection/MqttBrokerOptions.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route.MqttNet/Connection/MqttBrokerOptions.cs
----
namespace redb.Route.MqttNet.Connection;
///
/// Options for connecting to an MQTT broker.
///
public sealed class MqttBrokerOptions
{
/// Broker server hostname or IP.
public string Server { get; set; } = "localhost";
/// Broker port. Default 1883.
public int Port { get; set; } = 1883;
/// Username for authentication.
public string? Username { get; set; }
/// Password for authentication.
public string? Password { get; set; }
/// Client ID prefix. Final ID may include a unique suffix.
public string? ClientId { get; set; }
/// Enable TLS.
public bool UseTls { get; set; }
/// Keep-alive interval in seconds.
public int KeepAlive { get; set; } = 60;
/// Clean session / clean start.
public bool CleanSession { get; set; } = true;
///
/// MQTT 5 Session Expiry Interval in seconds: how long the broker keeps the session after the connection closes.
/// 0 (the default) ends the session with the connection.
///
public int SessionExpiryInterval { get; set; }
}