Class MqttConsumerEndpointBuilder
Builds the MqttConsumerEndpoint.
Inheritance
Implements
Inherited Members
Namespace: Silverback.Messaging.Configuration.Mqtt
Assembly: Silverback.Integration.MQTT.dll
Syntax
public class MqttConsumerEndpointBuilder : ConsumerEndpointBuilder<MqttConsumerEndpoint, IMqttConsumerEndpointBuilder>, IMqttConsumerEndpointBuilder, IConsumerEndpointBuilder<IMqttConsumerEndpointBuilder>, IEndpointBuilder<IMqttConsumerEndpointBuilder>
Constructors
| Improve this doc View sourceMqttConsumerEndpointBuilder(MqttClientConfig, Type?, IEndpointsConfigurationBuilder?)
Initializes a new instance of the MqttConsumerEndpointBuilder class.
Declaration
public MqttConsumerEndpointBuilder(MqttClientConfig clientConfig, Type? messageType = null, IEndpointsConfigurationBuilder? endpointsConfigurationBuilder = null)
Parameters
Type | Name | Description |
---|---|---|
MqttClientConfig | clientConfig | The MqttClientConfig. |
Type | messageType | The type of the message being consumed. |
IEndpointsConfigurationBuilder | endpointsConfigurationBuilder | The optional reference to the IEndpointsConfigurationBuilder that instantiated the builder. |
Properties
| Improve this doc View sourceThis
Gets this instance.
Declaration
protected override IMqttConsumerEndpointBuilder This { get; }
Property Value
Type | Description |
---|---|
IMqttConsumerEndpointBuilder |
Overrides
Remarks
This is necessary to work around casting in the base classes.
Methods
| Improve this doc View sourceConfigure(Action<IMqttClientConfigBuilder>)
Configures the MQTT client properties.
Declaration
public IMqttConsumerEndpointBuilder Configure(Action<IMqttClientConfigBuilder> configBuilderAction)
Parameters
Type | Name | Description |
---|---|---|
Action<IMqttClientConfigBuilder> | configBuilderAction | An Action<T> that takes the IMqttClientConfigBuilder and configures it. |
Returns
Type | Description |
---|---|
IMqttConsumerEndpointBuilder | The IMqttConsumerEndpointBuilder so that additional calls can be chained. |
Configure(Action<MqttClientConfig>)
Configures the MQTT client properties.
Declaration
public IMqttConsumerEndpointBuilder Configure(Action<MqttClientConfig> configAction)
Parameters
Type | Name | Description |
---|---|---|
Action<MqttClientConfig> | configAction | An Action<T> that takes the MqttClientConfig and configures it. |
Returns
Type | Description |
---|---|
IMqttConsumerEndpointBuilder | The IMqttConsumerEndpointBuilder so that additional calls can be chained. |
ConsumeFrom(params string[])
Specifies the name of the topics or the topic filter strings.
Declaration
public IMqttConsumerEndpointBuilder ConsumeFrom(params string[] topics)
Parameters
Type | Name | Description |
---|---|---|
string[] | topics | The name of the topics or the topic filter string. |
Returns
Type | Description |
---|---|
IMqttConsumerEndpointBuilder | The IMqttConsumerEndpointBuilder so that additional calls can be chained. |
CreateEndpoint()
Creates the endpoint to be configured according to the options stored in the builder.
Declaration
protected override MqttConsumerEndpoint CreateEndpoint()
Returns
Type | Description |
---|---|
MqttConsumerEndpoint | The endpoint. |
Overrides
| Improve this doc View sourceDisableParallelProcessing()
Disables parallel messages processing, setting the max degree of parallelism to 1 (default).
Declaration
public IMqttConsumerEndpointBuilder DisableParallelProcessing()
Returns
Type | Description |
---|---|
IMqttConsumerEndpointBuilder | The IMqttConsumerEndpointBuilder so that additional calls can be chained. |
EnableParallelProcessing(int)
Enables parallel processing and sets the maximum number of incoming message that can be processed concurrently.
Declaration
public IMqttConsumerEndpointBuilder EnableParallelProcessing(int maxDegreeOfParallelism)
Parameters
Type | Name | Description |
---|---|---|
int | maxDegreeOfParallelism | The maximum number of incoming message that can be processed concurrently. |
Returns
Type | Description |
---|---|
IMqttConsumerEndpointBuilder | The IMqttConsumerEndpointBuilder so that additional calls can be chained. |
LimitBackpressure(int)
Sets the maximum number of messages to be consumed and enqueued waiting to be processed. The default limit is 1.
Declaration
public IMqttConsumerEndpointBuilder LimitBackpressure(int backpressureLimit)
Parameters
Type | Name | Description |
---|---|---|
int | backpressureLimit | The maximum number of messages to be enqueued. |
Returns
Type | Description |
---|---|
IMqttConsumerEndpointBuilder | The IMqttConsumerEndpointBuilder so that additional calls can be chained. |
WithAtLeastOnceQoS()
Specifies that the topics have to be subscribed with the at least once quality of service level.
Declaration
public IMqttConsumerEndpointBuilder WithAtLeastOnceQoS()
Returns
Type | Description |
---|---|
IMqttConsumerEndpointBuilder | The IMqttConsumerEndpointBuilder 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 IMqttConsumerEndpointBuilder WithAtMostOnceQoS()
Returns
Type | Description |
---|---|
IMqttConsumerEndpointBuilder | The IMqttConsumerEndpointBuilder 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 IMqttConsumerEndpointBuilder WithExactlyOnceQoS()
Returns
Type | Description |
---|---|
IMqttConsumerEndpointBuilder | The IMqttConsumerEndpointBuilder so that additional calls can be chained. |
WithQualityOfServiceLevel(MqttQualityOfServiceLevel)
Specifies the desired quality of service level.
Declaration
public IMqttConsumerEndpointBuilder WithQualityOfServiceLevel(MqttQualityOfServiceLevel qosLevel)
Parameters
Type | Name | Description |
---|---|---|
MqttQualityOfServiceLevel | qosLevel | The MQTTnet.Protocol.MqttQualityOfServiceLevel. |
Returns
Type | Description |
---|---|
IMqttConsumerEndpointBuilder | The IMqttConsumerEndpointBuilder so that additional calls can be chained. |