Show / Hide Table of Contents

    Class MqttClientConfig

    The configuration used to connect with the MQTT broker. This is actually a wrapper around the MQTTnet.Client.MqttClientOptions from the MQTTnet library.

    Inheritance
    object
    MqttClientConfig
    Implements
    IEquatable<MqttClientConfig>
    IValidatableEndpointSettings
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Configuration.Mqtt
    Assembly: Silverback.Integration.MQTT.dll
    Syntax
    public sealed class MqttClientConfig : IEquatable<MqttClientConfig>, IValidatableEndpointSettings

    Constructors

    | Improve this doc View source

    MqttClientConfig(MqttClientOptions?)

    Initializes a new instance of the MqttClientConfig class.

    Declaration
    public MqttClientConfig(MqttClientOptions? clientOptions = null)
    Parameters
    Type Name Description
    MqttClientOptions clientOptions

    The MQTTnet.Client.MqttClientOptions to be wrapped.

    Properties

    | Improve this doc View source

    AuthenticationData

    Gets or sets the authentication data. Hint: MQTT 5 feature only.

    Declaration
    public byte[]? AuthenticationData { get; set; }
    Property Value
    Type Description
    byte[]
    | Improve this doc View source

    AuthenticationMethod

    Gets or sets the authentication method. Hint: MQTT 5 feature only.

    Declaration
    public string? AuthenticationMethod { get; set; }
    Property Value
    Type Description
    string
    | Improve this doc View source

    ChannelOptions

    Gets or sets the channel options (either MQTTnet.Client.MqttClientTcpOptions or MQTTnet.Client.MqttClientWebSocketOptions).

    Declaration
    public IMqttClientChannelOptions? ChannelOptions { get; set; }
    Property Value
    Type Description
    IMqttClientChannelOptions
    | Improve this doc View source

    CleanSession

    Gets or sets a value indicating whether clean sessions are used or not. When a client connects to a broker it can connect using either a non persistent connection (clean session) or a persistent connection. With a non persistent connection the broker doesn't store any subscription information or undelivered messages for the client. This mode is ideal when the client only publishes messages. It can also connect as a durable client using a persistent connection. In this mode, the broker will store subscription information, and undelivered messages for the client.

    Declaration
    public bool CleanSession { get; set; }
    Property Value
    Type Description
    bool
    | Improve this doc View source

    ClientId

    Gets or sets the client identifier. Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues.

    Declaration
    public string ClientId { get; set; }
    Property Value
    Type Description
    string
    | Improve this doc View source

    Credentials

    Gets or sets the credential to be used to authenticate with the message broker.

    Declaration
    public IMqttClientCredentialsProvider? Credentials { get; set; }
    Property Value
    Type Description
    IMqttClientCredentialsProvider
    | Improve this doc View source

    ExtendedAuthenticationExchangeHandler

    Gets or sets the handler to be used to handle the custom authentication data exchange.

    Declaration
    public IMqttExtendedAuthenticationExchangeHandler? ExtendedAuthenticationExchangeHandler { get; set; }
    Property Value
    Type Description
    IMqttExtendedAuthenticationExchangeHandler
    | Improve this doc View source

    KeepAlivePeriod

    Gets or sets the maximum period that can elapse without a packet being sent to the message broker. When this period is elapsed a ping packet will be sent to keep the connection alive. The default is 15 seconds.

    Declaration
    public TimeSpan KeepAlivePeriod { get; set; }
    Property Value
    Type Description
    TimeSpan
    | Improve this doc View source

    MaximumPacketSize

    Gets or sets the maximum packet size in byte the client will process. The default is no limit.

    Declaration
    public uint MaximumPacketSize { get; set; }
    Property Value
    Type Description
    uint
    | Improve this doc View source

    ProtocolVersion

    Gets or sets the MQTT protocol version. The default is MQTTnet.Formatter.MqttProtocolVersion.V500.

    Declaration
    public MqttProtocolVersion ProtocolVersion { get; set; }
    Property Value
    Type Description
    MqttProtocolVersion
    | Improve this doc View source

    ReceiveMaximum

    Gets or sets the receive maximum. This gives the maximum length of the receive messages.

    Declaration
    public ushort ReceiveMaximum { get; set; }
    Property Value
    Type Description
    ushort
    | Improve this doc View source

    RequestProblemInformation

    Gets or sets a value indicating whether the problem information must be requested. Hint: MQTT 5 feature only.

    Declaration
    public bool RequestProblemInformation { get; set; }
    Property Value
    Type Description
    bool
    | Improve this doc View source

    RequestResponseInformation

    Gets or sets a value indicating whether the response information must be requested. Hint: MQTT 5 feature only.

    Declaration
    public bool RequestResponseInformation { get; set; }
    Property Value
    Type Description
    bool
    | Improve this doc View source

    SessionExpiryInterval

    Gets or sets the session expiry interval. The time after a session expires when it's not actively used.

    Declaration
    public uint SessionExpiryInterval { get; set; }
    Property Value
    Type Description
    uint
    | Improve this doc View source

    Timeout

    Gets or sets the timeout which will be applied at socket level and internal operations. The default value is the same as for sockets in .NET in general.

    Declaration
    public TimeSpan Timeout { get; set; }
    Property Value
    Type Description
    TimeSpan
    | Improve this doc View source

    TopicAliasMaximum

    Gets or sets the topic alias maximum. This gives the maximum length of the topic alias.

    Declaration
    public ushort TopicAliasMaximum { get; set; }
    Property Value
    Type Description
    ushort
    | Improve this doc View source

    TryPrivate

    If set to true, the bridge will attempt to indicate to the remote broker that it is a bridge not an ordinary client. If successful, this means that loop detection will be more effective and that retained messages will be propagated correctly. Not all brokers support this feature so it may be necessary to set it to false if your bridge does not connect properly.

    Declaration
    public bool TryPrivate { get; set; }
    Property Value
    Type Description
    bool
    | Improve this doc View source

    UserProperties

    Gets the user properties. In MQTT 5, user properties are basic UTF-8 string key-value pairs that you can append to almost every type of MQTT packet. As long as you don’t exceed the maximum message size, you can use an unlimited number of user properties to add metadata to MQTT messages and pass information between publisher, broker, and subscriber. The feature is very similar to the HTTP header concept. Hint: MQTT 5 feature only.

    Declaration
    public IList<MqttUserProperty> UserProperties { get; }
    Property Value
    Type Description
    IList<MqttUserProperty>
    | Improve this doc View source

    WillContentType

    Gets or sets the content type of the will message.

    Declaration
    public string WillContentType { get; set; }
    Property Value
    Type Description
    string
    | Improve this doc View source

    WillCorrelationData

    Gets or sets the correlation data of the will message.

    Declaration
    public byte[] WillCorrelationData { get; set; }
    Property Value
    Type Description
    byte[]
    | Improve this doc View source

    WillDelayInterval

    Gets or sets the will delay interval. This is the time between the client disconnect and the time the will message will be sent.

    Declaration
    public uint WillDelayInterval { get; set; }
    Property Value
    Type Description
    uint
    | Improve this doc View source

    WillMessageExpiryInterval

    Gets or sets the message expiry interval of the will message.

    Declaration
    public uint WillMessageExpiryInterval { get; set; }
    Property Value
    Type Description
    uint
    | Improve this doc View source

    WillPayload

    Gets or sets the payload of the will message.

    Declaration
    public byte[] WillPayload { get; set; }
    Property Value
    Type Description
    byte[]
    | Improve this doc View source

    WillPayloadFormatIndicator

    Gets or sets the payload format indicator of the will message.

    Declaration
    public MqttPayloadFormatIndicator WillPayloadFormatIndicator { get; set; }
    Property Value
    Type Description
    MqttPayloadFormatIndicator
    | Improve this doc View source

    WillQualityOfServiceLevel

    Gets or sets the QoS level of the will message.

    Declaration
    public MqttQualityOfServiceLevel WillQualityOfServiceLevel { get; set; }
    Property Value
    Type Description
    MqttQualityOfServiceLevel
    | Improve this doc View source

    WillResponseTopic

    Gets or sets the response topic of the will message.

    Declaration
    public string WillResponseTopic { get; set; }
    Property Value
    Type Description
    string
    | Improve this doc View source

    WillRetain

    Gets or sets the retain flag of the will message.

    Declaration
    public bool WillRetain { get; set; }
    Property Value
    Type Description
    bool
    | Improve this doc View source

    WillTopic

    Gets or sets the topic of the will message.

    Declaration
    public string WillTopic { get; set; }
    Property Value
    Type Description
    string
    | Improve this doc View source

    WillUserProperties

    Gets the user properties of the will message.

    Declaration
    public IList<MqttUserProperty> WillUserProperties { get; }
    Property Value
    Type Description
    IList<MqttUserProperty>
    | Improve this doc View source

    WriterBufferSize

    Gets or sets the default and initial size of the packet write buffer. It is recommended to set this to a value close to the usual expected packet size * 1.5. Do not change this value when no memory issues are experienced.

    Declaration
    public int WriterBufferSize { get; set; }
    Property Value
    Type Description
    int
    | Improve this doc View source

    WriterBufferSizeMax

    Gets or sets the maximum size of the buffer writer. The writer will reduce its internal buffer to this value after serializing a packet. Do not change this value when no memory issues are experienced.

    Declaration
    public int WriterBufferSizeMax { get; set; }
    Property Value
    Type Description
    int

    Methods

    | Improve this doc View source

    Equals(MqttClientConfig?)

    Indicates whether the current object is equal to another object of the same type.

    Declaration
    public bool Equals(MqttClientConfig? other)
    Parameters
    Type Name Description
    MqttClientConfig other

    An object to compare with this object.

    Returns
    Type Description
    bool

    true if the current object is equal to the other parameter; otherwise, false.

    | Improve this doc View source

    Equals(object?)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current object.

    Returns
    Type Description
    bool

    true if the specified object is equal to the current object; otherwise, false.

    Overrides
    object.Equals(object)
    | Improve this doc View source

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    object.GetHashCode()
    | Improve this doc View source

    Validate()

    Throws an EndpointConfigurationException if the current configuration is not valid.

    Declaration
    public void Validate()

    Implements

    IEquatable<T>
    IValidatableEndpointSettings
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini