Table of Contents

Class MqttLastWillMessageConfiguration

Namespace
Silverback.Messaging.Configuration.Mqtt
Assembly
Silverback.Integration.MQTT.dll

The configuration of the last will message to be sent when the client disconnects ungracefully.

public record MqttLastWillMessageConfiguration : IValidatableSettings, IEquatable<MqttLastWillMessageConfiguration>
Inheritance
MqttLastWillMessageConfiguration
Implements
Inherited Members

Constructors

MqttLastWillMessageConfiguration()

public MqttLastWillMessageConfiguration()

MqttLastWillMessageConfiguration(MqttLastWillMessageConfiguration)

protected MqttLastWillMessageConfiguration(MqttLastWillMessageConfiguration original)

Parameters

original MqttLastWillMessageConfiguration

Properties

ContentType

Gets the content type.

public string? ContentType { get; init; }

Property Value

string

CorrelationData

Gets the correlation data.

public byte[]? CorrelationData { get; init; }

Property Value

byte[]

Delay

Gets the number of seconds to wait before sending the last will message. If the client reconnects between this interval the message will not be sent.

public uint Delay { get; init; }

Property Value

uint

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Expiration

Gets the message expiry interval.

public uint Expiration { get; init; }

Property Value

uint

Payload

Gets the message payload.

public byte[]? Payload { get; init; }

Property Value

byte[]

PayloadFormatIndicator

Gets the payload format indicator.

public MqttPayloadFormatIndicator PayloadFormatIndicator { get; init; }

Property Value

MqttPayloadFormatIndicator

QualityOfServiceLevel

Gets the quality of service level (at most once, at least once or exactly once). The default is MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce.

public MqttQualityOfServiceLevel QualityOfServiceLevel { get; init; }

Property Value

MqttQualityOfServiceLevel

ResponseTopic

Gets the response topic.

public string? ResponseTopic { get; init; }

Property Value

string

Retain

Gets a value indicating whether the message have to be sent with the retain flag, causing them to be persisted on the broker. The default is false.

public bool Retain { get; init; }

Property Value

bool

Topic

Gets the target topic.

public string Topic { get; init; }

Property Value

string

UserProperties

Gets the user properties of the will message.

public IValueReadOnlyCollection<MqttUserProperty> UserProperties { get; init; }

Property Value

IValueReadOnlyCollection<MqttUserProperty>

Methods

Equals(MqttLastWillMessageConfiguration?)

public virtual bool Equals(MqttLastWillMessageConfiguration? other)

Parameters

other MqttLastWillMessageConfiguration

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Validate()

Throws a SilverbackConfigurationException if the configuration is not valid.

public void Validate()

Operators

operator ==(MqttLastWillMessageConfiguration?, MqttLastWillMessageConfiguration?)

public static bool operator ==(MqttLastWillMessageConfiguration? left, MqttLastWillMessageConfiguration? right)

Parameters

left MqttLastWillMessageConfiguration
right MqttLastWillMessageConfiguration

Returns

bool

operator !=(MqttLastWillMessageConfiguration?, MqttLastWillMessageConfiguration?)

public static bool operator !=(MqttLastWillMessageConfiguration? left, MqttLastWillMessageConfiguration? right)

Parameters

left MqttLastWillMessageConfiguration
right MqttLastWillMessageConfiguration

Returns

bool