Interface IMqttProducerEndpointBuilder
Builds the MqttProducerEndpoint.
Inherited Members
Namespace: Silverback.Messaging.Configuration.Mqtt
Assembly: Silverback.Integration.MQTT.dll
Syntax
public interface IMqttProducerEndpointBuilder : IProducerEndpointBuilder<IMqttProducerEndpointBuilder>, IEndpointBuilder<IMqttProducerEndpointBuilder>
Methods
| Improve this doc View sourceConfigure(Action<IMqttClientConfigBuilder>)
Configures the MQTT client properties.
Declaration
IMqttProducerEndpointBuilder Configure(Action<IMqttClientConfigBuilder> configBuilderAction)
Parameters
Type | Name | Description |
---|---|---|
Action<IMqttClientConfigBuilder> | configBuilderAction | An Action<T> that takes the IMqttClientConfigBuilder and configures it. |
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
Configure(Action<MqttClientConfig>)
Configures the MQTT client properties.
Declaration
IMqttProducerEndpointBuilder Configure(Action<MqttClientConfig> configAction)
Parameters
Type | Name | Description |
---|---|---|
Action<MqttClientConfig> | configAction | An Action<T> that takes the MqttClientConfig and configures it. |
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
ProduceTo(Func<IOutboundEnvelope, IServiceProvider, string?>)
Specifies the name of the topic and optionally the target partition.
Declaration
IMqttProducerEndpointBuilder ProduceTo(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
|
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
ProduceTo(Func<IOutboundEnvelope, string?>)
Specifies the name of the topic and optionally the target partition.
Declaration
IMqttProducerEndpointBuilder ProduceTo(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
|
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
ProduceTo(string)
Specifies the name of the topic.
Declaration
IMqttProducerEndpointBuilder ProduceTo(string topicName)
Parameters
Type | Name | Description |
---|---|---|
string | topicName | The name of the topic. |
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
ProduceTo(string, Func<IOutboundEnvelope, string[]>)
Specifies the name of the topic and optionally the target partition.
Declaration
IMqttProducerEndpointBuilder ProduceTo(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. |
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
ProduceTo<TMessage>(Func<IOutboundEnvelope<TMessage>, IServiceProvider, string?>)
Specifies the name of the topic and optionally the target partition.
Declaration
IMqttProducerEndpointBuilder ProduceTo<TMessage>(Func<IOutboundEnvelope<TMessage>, IServiceProvider, string?> topicNameFunction) where TMessage : class
Parameters
Type | Name | Description |
---|---|---|
Func<IOutboundEnvelope<TMessage>, IServiceProvider, string> | topicNameFunction | The function returning the topic name for the message being produced. If the function returns
|
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages being produced. |
ProduceTo<TMessage>(Func<IOutboundEnvelope<TMessage>, string?>)
Specifies the name of the topic and optionally the target partition.
Declaration
IMqttProducerEndpointBuilder ProduceTo<TMessage>(Func<IOutboundEnvelope<TMessage>, string?> topicNameFunction) where TMessage : class
Parameters
Type | Name | Description |
---|---|---|
Func<IOutboundEnvelope<TMessage>, string> | topicNameFunction | The function returning the topic name for the message being produced. If the function returns
|
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages being produced. |
ProduceTo<TMessage>(string, Func<IOutboundEnvelope<TMessage>, string[]>)
Specifies the name of the topic and optionally the target partition.
Declaration
IMqttProducerEndpointBuilder ProduceTo<TMessage>(string topicNameFormatString, Func<IOutboundEnvelope<TMessage>, string[]> topicNameArgumentsFunction) where TMessage : class
Parameters
Type | Name | Description |
---|---|---|
string | topicNameFormatString | The endpoint name format string that will be combined with the arguments returned by the
|
Func<IOutboundEnvelope<TMessage>, string[]> | topicNameArgumentsFunction | The function returning the arguments to be used to format the string. |
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages being produced. |
Retain()
Specifies that the messages have to be sent with the retain flag, causing them to be persisted on the broker.
Declaration
IMqttProducerEndpointBuilder Retain()
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
UseEndpointNameResolver<TResolver>()
Specifies the type of the IProducerEndpointNameResolver to be used to resolve the actual endpoint name and partition.
Declaration
IMqttProducerEndpointBuilder UseEndpointNameResolver<TResolver>() where TResolver : IProducerEndpointNameResolver
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TResolver | The type of the IProducerEndpointNameResolver to be used. |
WithAtLeastOnceQoS()
Specifies that the messages have to be sent with the at least once quality of service level.
Declaration
IMqttProducerEndpointBuilder WithAtLeastOnceQoS()
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
WithAtMostOnceQoS()
Specifies that the messages have to be sent with the at most once quality of service level.
Declaration
IMqttProducerEndpointBuilder WithAtMostOnceQoS()
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
WithExactlyOnceQoS()
Specifies that the messages have to be sent with the exactly once quality of service level.
Declaration
IMqttProducerEndpointBuilder WithExactlyOnceQoS()
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
WithMessageExpiration(TimeSpan)
Sets the message expiry interval. 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
IMqttProducerEndpointBuilder WithMessageExpiration(TimeSpan messageExpiryInterval)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | messageExpiryInterval | The TimeSpan representing the message expiry interval. |
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |
WithQualityOfServiceLevel(MqttQualityOfServiceLevel)
Specifies the desired quality of service level.
Declaration
IMqttProducerEndpointBuilder WithQualityOfServiceLevel(MqttQualityOfServiceLevel qosLevel)
Parameters
Type | Name | Description |
---|---|---|
MqttQualityOfServiceLevel | qosLevel | The MQTTnet.Protocol.MqttQualityOfServiceLevel. |
Returns
Type | Description |
---|---|
IMqttProducerEndpointBuilder | The IMqttProducerEndpointBuilder so that additional calls can be chained. |