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
System.Object
MqttClientConfig
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Silverback.Integration.MQTT.dll
Syntax
public sealed class MqttClientConfig : IEquatable<MqttClientConfig>, IValidatableEndpointSettings
Constructors
|
Improve this doc
View source
MqttClientConfig(MqttClientOptions)
Declaration
public MqttClientConfig(MqttClientOptions clientOptions = null)
Parameters
Type |
Name |
Description |
MQTTnet.Client.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 |
System.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 |
System.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 |
MQTTnet.Client.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 |
System.Boolean |
|
|
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 |
System.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 |
MQTTnet.Client.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 |
MQTTnet.Client.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 |
System.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 |
System.UInt32 |
|
|
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 |
MQTTnet.Formatter.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 |
System.UInt16 |
|
|
Improve this doc
View source
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 |
System.Boolean |
|
|
Improve this doc
View source
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 |
System.Boolean |
|
|
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 |
System.UInt32 |
|
|
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 |
System.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 |
System.UInt16 |
|
|
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 |
System.Boolean |
|
|
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 |
System.Collections.Generic.IList<MQTTnet.Packets.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 |
System.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 |
System.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 |
System.UInt32 |
|
|
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 |
System.UInt32 |
|
|
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 |
System.Byte[] |
|
|
Improve this doc
View source
Gets or sets the payload format indicator of the will message.
Declaration
public MqttPayloadFormatIndicator WillPayloadFormatIndicator { get; set; }
Property Value
Type |
Description |
MQTTnet.Protocol.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 |
MQTTnet.Protocol.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 |
System.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 |
System.Boolean |
|
|
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 |
System.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 |
System.Collections.Generic.IList<MQTTnet.Packets.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 |
System.Int32 |
|
|
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 |
System.Int32 |
|
Methods
|
Improve this doc
View source
Equals(MqttClientConfig)
Declaration
public bool Equals(MqttClientConfig other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this doc
View source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
|
Improve this doc
View source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.Object.GetHashCode()
|
Improve this doc
View source
Validate()
Declaration
Implements
System.IEquatable<T>