Class MqttProducerEndpoint
Represents a topic to produce to.
Inherited Members
Namespace: Silverback.Messaging
Assembly: Silverback.Integration.MQTT.dll
Syntax
public sealed class MqttProducerEndpoint : ProducerEndpoint, IProducerEndpoint, IEndpoint, IEquatable<MqttProducerEndpoint>
Constructors
| Improve this doc View sourceMqttProducerEndpoint(Func<IOutboundEnvelope, IServiceProvider, string?>)
Initializes a new instance of the MqttProducerEndpoint class.
Declaration
public MqttProducerEndpoint(Func<IOutboundEnvelope, IServiceProvider, string?> topicNameFunction)
Parameters
Type | Name | Description |
---|---|---|
Func<IOutboundEnvelope, IServiceProvider, string> | topicNameFunction | The function returning the topic name for the message being produced. If the function returns
|
MqttProducerEndpoint(Func<IOutboundEnvelope, string?>)
Initializes a new instance of the MqttProducerEndpoint class.
Declaration
public MqttProducerEndpoint(Func<IOutboundEnvelope, string?> topicNameFunction)
Parameters
Type | Name | Description |
---|---|---|
Func<IOutboundEnvelope, string> | topicNameFunction | The function returning the topic name for the message being produced. If the function returns
|
MqttProducerEndpoint(string)
Initializes a new instance of the MqttProducerEndpoint class.
Declaration
public MqttProducerEndpoint(string topicName)
Parameters
Type | Name | Description |
---|---|---|
string | topicName | The name of the topic. |
MqttProducerEndpoint(string, Func<IOutboundEnvelope, string[]>)
Initializes a new instance of the MqttProducerEndpoint class.
Declaration
public MqttProducerEndpoint(string topicNameFormatString, Func<IOutboundEnvelope, string[]> topicNameArgumentsFunction)
Parameters
Type | Name | Description |
---|---|---|
string | topicNameFormatString | The endpoint name format string that will be combined with the arguments returned by the
|
Func<IOutboundEnvelope, string[]> | topicNameArgumentsFunction | The function returning the arguments to be used to format the string. |
MqttProducerEndpoint(Type)
Initializes a new instance of the MqttProducerEndpoint class.
Declaration
public MqttProducerEndpoint(Type resolverType)
Parameters
Type | Name | Description |
---|---|---|
Type | resolverType | The type of the IProducerEndpointNameResolver to be used to resolve the actual endpoint name. |
Properties
| Improve this doc View sourceConfiguration
Gets or sets the MQTT client configuration. This is actually a wrapper around the MQTTnet.Client.MqttClientOptions from the MQTTnet library.
Declaration
public MqttClientConfig Configuration { get; set; }
Property Value
Type | Description |
---|---|
MqttClientConfig |
MessageExpiryInterval
Gets or sets the message expiry interval in seconds. This interval defines the period of time that the broker stores the PUBLISH message for any matching subscribers that are not currently connected. When no message expiry interval is set, the broker must store the message for matching subscribers indefinitely.
Declaration
public uint MessageExpiryInterval { get; set; }
Property Value
Type | Description |
---|---|
uint |
QualityOfServiceLevel
Gets or sets the quality of service level (at most once, at least once or exactly once).
Declaration
public MqttQualityOfServiceLevel QualityOfServiceLevel { get; set; }
Property Value
Type | Description |
---|---|
MqttQualityOfServiceLevel |
Retain
Gets or sets a value indicating whether the message have to be sent with the retain flag, causing them to be persisted on the broker.
Declaration
public bool Retain { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Improve this doc View sourceEquals(MqttProducerEndpoint?)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(MqttProducerEndpoint? other)
Parameters
Type | Name | Description |
---|---|---|
MqttProducerEndpoint | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
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
| Improve this doc View sourceGetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current object. |
Overrides
| Improve this doc View sourceValidate()
Validates the endpoint configuration and throws an EndpointConfigurationException if not valid.
Declaration
public override void Validate()