Show / Hide Table of Contents

    Class MqttProducerEndpointBuilder

    Builds the MqttProducerEndpoint.

    Inheritance
    object
    EndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>
    ProducerEndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>
    MqttProducerEndpointBuilder
    Implements
    IMqttProducerEndpointBuilder
    IProducerEndpointBuilder<IMqttProducerEndpointBuilder>
    IEndpointBuilder<IMqttProducerEndpointBuilder>
    Inherited Members
    ProducerEndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.SerializeUsing(IMessageSerializer)
    ProducerEndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.Encrypt(EncryptionSettings)
    ProducerEndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.UseStrategy(IProduceStrategy)
    ProducerEndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.ProduceDirectly()
    ProducerEndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.ProduceToOutbox()
    ProducerEndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.EnableChunking(int, bool)
    ProducerEndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.AddHeader(string, object)
    ProducerEndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.AddHeader<TMessage>(string, object)
    ProducerEndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.AddHeader<TMessage>(string, Func<IOutboundEnvelope<TMessage>, object>)
    ProducerEndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.WithMessageId<TMessage>(Func<IOutboundEnvelope<TMessage>, object>)
    ProducerEndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.Build()
    EndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.MessageType
    EndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.EndpointsConfigurationBuilder
    EndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.This
    EndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.WithName(string)
    EndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.UseSerializer(IMessageSerializer)
    EndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.WithEncryption(EncryptionSettings)
    EndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.ValidateMessage(bool)
    EndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.DisableMessageValidation()
    EndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.CreateEndpoint()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Configuration.Mqtt
    Assembly: Silverback.Integration.MQTT.dll
    Syntax
    public class MqttProducerEndpointBuilder : ProducerEndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>, IMqttProducerEndpointBuilder, IProducerEndpointBuilder<IMqttProducerEndpointBuilder>, IEndpointBuilder<IMqttProducerEndpointBuilder>

    Constructors

    | Improve this doc View source

    MqttProducerEndpointBuilder(MqttClientConfig, Type?, IEndpointsConfigurationBuilder?)

    Initializes a new instance of the MqttProducerEndpointBuilder class.

    Declaration
    public MqttProducerEndpointBuilder(MqttClientConfig clientConfig, Type? messageType = null, IEndpointsConfigurationBuilder? endpointsConfigurationBuilder = null)
    Parameters
    Type Name Description
    MqttClientConfig clientConfig

    The MqttClientConfig.

    Type messageType

    The type of the message being produced.

    IEndpointsConfigurationBuilder endpointsConfigurationBuilder

    The optional reference to the IEndpointsConfigurationBuilder that instantiated the builder.

    Properties

    | Improve this doc View source

    This

    Gets this instance.

    Declaration
    protected override IMqttProducerEndpointBuilder This { get; }
    Property Value
    Type Description
    IMqttProducerEndpointBuilder
    Overrides
    EndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.This
    Remarks

    This is necessary to work around casting in the base classes.

    Methods

    | Improve this doc View source

    Configure(Action<IMqttClientConfigBuilder>)

    Configures the MQTT client properties.

    Declaration
    public 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.

    | Improve this doc View source

    Configure(Action<MqttClientConfig>)

    Configures the MQTT client properties.

    Declaration
    public 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.

    | Improve this doc View source

    CreateEndpoint()

    Creates the endpoint to be configured according to the options stored in the builder.

    Declaration
    protected override MqttProducerEndpoint CreateEndpoint()
    Returns
    Type Description
    MqttProducerEndpoint

    The endpoint.

    Overrides
    EndpointBuilder<MqttProducerEndpoint, IMqttProducerEndpointBuilder>.CreateEndpoint()
    | Improve this doc View source

    ProduceTo(Func<IOutboundEnvelope, IServiceProvider, string?>)

    Specifies the name of the topic and optionally the target partition.

    Declaration
    public 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 null the message will not be produced.

    Returns
    Type Description
    IMqttProducerEndpointBuilder

    The IMqttProducerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    ProduceTo(Func<IOutboundEnvelope, string?>)

    Specifies the name of the topic and optionally the target partition.

    Declaration
    public 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 null the message will not be produced.

    Returns
    Type Description
    IMqttProducerEndpointBuilder

    The IMqttProducerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    ProduceTo(string)

    Specifies the name of the topic.

    Declaration
    public 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.

    | Improve this doc View source

    ProduceTo(string, Func<IOutboundEnvelope, string[]>)

    Specifies the name of the topic and optionally the target partition.

    Declaration
    public 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 topicNameArgumentsFunction using a string.Format.

    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.

    | Improve this doc View source

    ProduceTo<TMessage>(Func<IOutboundEnvelope<TMessage>, IServiceProvider, string?>)

    Specifies the name of the topic and optionally the target partition.

    Declaration
    public 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 null the message will not be produced.

    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.

    | Improve this doc View source

    ProduceTo<TMessage>(Func<IOutboundEnvelope<TMessage>, string?>)

    Specifies the name of the topic and optionally the target partition.

    Declaration
    public 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 null the message will not be produced.

    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.

    | Improve this doc View source

    ProduceTo<TMessage>(string, Func<IOutboundEnvelope<TMessage>, string[]>)

    Specifies the name of the topic and optionally the target partition.

    Declaration
    public 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 topicNameArgumentsFunction using a string.Format.

    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.

    | Improve this doc View source

    Retain()

    Specifies that the messages have to be sent with the retain flag, causing them to be persisted on the broker.

    Declaration
    public IMqttProducerEndpointBuilder Retain()
    Returns
    Type Description
    IMqttProducerEndpointBuilder

    The IMqttProducerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    UseEndpointNameResolver<TResolver>()

    Specifies the type of the IProducerEndpointNameResolver to be used to resolve the actual endpoint name and partition.

    Declaration
    public 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.

    | Improve this doc View source

    WithAtLeastOnceQoS()

    Specifies that the messages have to be sent with the at least once quality of service level.

    Declaration
    public IMqttProducerEndpointBuilder WithAtLeastOnceQoS()
    Returns
    Type Description
    IMqttProducerEndpointBuilder

    The IMqttProducerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    WithAtMostOnceQoS()

    Specifies that the messages have to be sent with the at most once quality of service level.

    Declaration
    public IMqttProducerEndpointBuilder WithAtMostOnceQoS()
    Returns
    Type Description
    IMqttProducerEndpointBuilder

    The IMqttProducerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    WithExactlyOnceQoS()

    Specifies that the messages have to be sent with the exactly once quality of service level.

    Declaration
    public IMqttProducerEndpointBuilder WithExactlyOnceQoS()
    Returns
    Type Description
    IMqttProducerEndpointBuilder

    The IMqttProducerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    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
    public 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.

    | Improve this doc View source

    WithQualityOfServiceLevel(MqttQualityOfServiceLevel)

    Specifies the desired quality of service level.

    Declaration
    public 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.

    Implements

    IMqttProducerEndpointBuilder
    IProducerEndpointBuilder<TBuilder>
    IEndpointBuilder<TBuilder>

    Extension Methods

    ProducerEndpointBuilderEncryptUsingExtensions.EncryptUsingAes<TBuilder>(IProducerEndpointBuilder<TBuilder>, byte[], byte[]?)
    ProducerEndpointBuilderEncryptUsingExtensions.EncryptUsingAes<TBuilder>(IProducerEndpointBuilder<TBuilder>, byte[], string, byte[]?)
    ProducerEndpointBuilderProduceBinaryFilesExtensions.ProduceBinaryFiles<TBuilder>(IProducerEndpointBuilder<TBuilder>, Action<IBinaryFileMessageSerializerBuilder>?)
    ProducerEndpointBuilderSerializeAsJsonExtensions.SerializeAsJson<TBuilder>(IProducerEndpointBuilder<TBuilder>, Action<IJsonMessageSerializerBuilder>?)
    ProducerEndpointBuilderSerializeAsJsonUsingNewtonsoftExtensions.SerializeAsJsonUsingNewtonsoft<TBuilder>(IProducerEndpointBuilder<TBuilder>, Action<INewtonsoftJsonMessageSerializerBuilder>?)
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini