Class MqttConsumerEndpointConfigurationBuilder<TMessage>
Builds the MqttConsumerEndpoint.
Inheritance
Inherited Members
Namespace: Silverback.Messaging.Configuration.Mqtt
Assembly: Silverback.Integration.MQTT.dll
Syntax
public class MqttConsumerEndpointConfigurationBuilder<TMessage> : ConsumerEndpointConfigurationBuilder<TMessage, MqttConsumerEndpointConfiguration, MqttConsumerEndpointConfigurationBuilder<TMessage>>
Type Parameters
| Name | Description |
|---|---|
| TMessage | The type of the messages being consumed. |
Constructors
MqttConsumerEndpointConfigurationBuilder(IServiceProvider, string?)
Initializes a new instance of the MqttConsumerEndpointConfigurationBuilder<TMessage> class.
Declaration
public MqttConsumerEndpointConfigurationBuilder(IServiceProvider serviceProvider, string? friendlyName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceProvider | serviceProvider | The IServiceProvider. |
| string | friendlyName | An optional friendly to be shown in the human-targeted output (e.g. logs, health checks result, etc.). |
Properties
This
Gets this instance.
Declaration
protected override MqttConsumerEndpointConfigurationBuilder<TMessage> This { get; }
Property Value
| Type | Description |
|---|---|
| MqttConsumerEndpointConfigurationBuilder<TMessage> |
Overrides
Remarks
This is necessary to work around casting in the base classes.
Methods
ConsumeFrom(params string[])
Specifies the name of the topics or the topic filter strings.
Declaration
public MqttConsumerEndpointConfigurationBuilder<TMessage> ConsumeFrom(params string[] topics)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | topics | The name of the topics or the topic filter string. |
Returns
| Type | Description |
|---|---|
| MqttConsumerEndpointConfigurationBuilder<TMessage> | The MqttConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
CreateConfiguration()
Creates the TConfiguration instance.
Declaration
protected override MqttConsumerEndpointConfiguration CreateConfiguration()
Returns
| Type | Description |
|---|---|
| MqttConsumerEndpointConfiguration | The endpoint. |
Overrides
WithAtLeastOnceQoS()
Specifies that the topics have to be subscribed with the at least once quality of service level.
Declaration
public MqttConsumerEndpointConfigurationBuilder<TMessage> WithAtLeastOnceQoS()
Returns
| Type | Description |
|---|---|
| MqttConsumerEndpointConfigurationBuilder<TMessage> | The MqttConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
WithAtMostOnceQoS()
Specifies that the topics have to be subscribed with the at most once quality of service level.
Declaration
public MqttConsumerEndpointConfigurationBuilder<TMessage> WithAtMostOnceQoS()
Returns
| Type | Description |
|---|---|
| MqttConsumerEndpointConfigurationBuilder<TMessage> | The MqttConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
WithExactlyOnceQoS()
Specifies that the topics have to be subscribed with the exactly once quality of service level.
Declaration
public MqttConsumerEndpointConfigurationBuilder<TMessage> WithExactlyOnceQoS()
Returns
| Type | Description |
|---|---|
| MqttConsumerEndpointConfigurationBuilder<TMessage> | The MqttConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
WithQualityOfServiceLevel(MqttQualityOfServiceLevel)
Specifies the desired quality of service level.
Declaration
public MqttConsumerEndpointConfigurationBuilder<TMessage> WithQualityOfServiceLevel(MqttQualityOfServiceLevel qosLevel)
Parameters
| Type | Name | Description |
|---|---|---|
| MqttQualityOfServiceLevel | qosLevel | The MQTTnet.Protocol.MqttQualityOfServiceLevel. |
Returns
| Type | Description |
|---|---|
| MqttConsumerEndpointConfigurationBuilder<TMessage> | The MqttConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |