Show / Hide Table of Contents

    Interface IMqttEndpointsConfigurationBuilder

    Exposes the methods to configure the connection to Mqtt and add the inbound and outbound endpoints.

    Inherited Members
    IEndpointsConfigurationBuilder.ServiceProvider
    Namespace: Silverback.Messaging.Configuration.Mqtt
    Assembly: Silverback.Integration.MQTT.dll
    Syntax
    public interface IMqttEndpointsConfigurationBuilder : IEndpointsConfigurationBuilder

    Methods

    | Improve this doc View source

    AddInbound(Action<IMqttConsumerEndpointBuilder>)

    Adds an inbound endpoint and instantiates a MqttConsumer to consume from a Mqtt topic.

    Declaration
    IMqttEndpointsConfigurationBuilder AddInbound(Action<IMqttConsumerEndpointBuilder> endpointBuilderAction)
    Parameters
    Type Name Description
    Action<IMqttConsumerEndpointBuilder> endpointBuilderAction

    An Action<T> that takes the IMqttConsumerEndpointBuilder and configures it.

    Returns
    Type Description
    IMqttEndpointsConfigurationBuilder

    The IMqttEndpointsConfigurationBuilder so that additional calls can be chained.

    Remarks

    Multiple calls to this methods will cause multiple consumers to be instantiated, which means multiple connections being issues and more resources being used. The MqttConsumerEndpoint allows to define multiple topics to be consumed, to efficiently instantiate a single consumer for all of them.

    | Improve this doc View source

    AddInbound(Type?, Action<IMqttConsumerEndpointBuilder>)

    Adds an inbound endpoint and instantiates a MqttConsumer to consume from a Mqtt topic.

    Declaration
    IMqttEndpointsConfigurationBuilder AddInbound(Type? messageType, Action<IMqttConsumerEndpointBuilder> endpointBuilderAction)
    Parameters
    Type Name Description
    Type messageType

    The type of the messages that will be consumed from this endpoint. Specifying the message type will usually automatically switch to the typed message serializer and deserialize this specific type, regardless of the message headers.

    Action<IMqttConsumerEndpointBuilder> endpointBuilderAction

    An Action<T> that takes the IMqttConsumerEndpointBuilder and configures it.

    Returns
    Type Description
    IMqttEndpointsConfigurationBuilder

    The IMqttEndpointsConfigurationBuilder so that additional calls can be chained.

    Remarks

    Multiple calls to this methods will cause multiple consumers to be instantiated, which means multiple connections being issues and more resources being used. The MqttConsumerEndpoint allows to define multiple topics to be consumed, to efficiently instantiate a single consumer for all of them.

    | Improve this doc View source

    AddInbound<TMessage>(Action<IMqttConsumerEndpointBuilder>)

    Adds an inbound endpoint and instantiates a MqttConsumer to consume from a Mqtt topic.

    Declaration
    IMqttEndpointsConfigurationBuilder AddInbound<TMessage>(Action<IMqttConsumerEndpointBuilder> endpointBuilderAction)
    Parameters
    Type Name Description
    Action<IMqttConsumerEndpointBuilder> endpointBuilderAction

    An Action<T> that takes the IMqttConsumerEndpointBuilder and configures it.

    Returns
    Type Description
    IMqttEndpointsConfigurationBuilder

    The IMqttEndpointsConfigurationBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TMessage

    The type of the messages that will be consumed from this endpoint. Specifying the message type will usually automatically switch to the typed message serializer and deserialize this specific type, regardless of the message headers.

    Remarks

    Multiple calls to this methods will cause multiple consumers to be instantiated, which means multiple connections being issues and more resources being used. The MqttConsumerEndpoint allows to define multiple topics to be consumed, to efficiently instantiate a single consumer for all of them.

    | Improve this doc View source

    AddOutbound(Type, RouterFunction, IReadOnlyDictionary<string, Action<IMqttProducerEndpointBuilder>>, bool)

    Adds an outbound endpoint to produce the specified message type to a Mqtt topic.

    Declaration
    IMqttEndpointsConfigurationBuilder AddOutbound(Type messageType, DictionaryOutboundRouter<object, MqttProducerEndpoint>.RouterFunction routerFunction, IReadOnlyDictionary<string, Action<IMqttProducerEndpointBuilder>> endpointBuilderActions, bool preloadProducers = true)
    Parameters
    Type Name Description
    Type messageType

    The type of the messages to be published to this endpoint.

    DictionaryOutboundRouter<object, MqttProducerEndpoint>.RouterFunction routerFunction

    The DictionaryOutboundRouter<TMessage, TEndpoint>.RouterFunction.

    IReadOnlyDictionary<string, Action<IMqttProducerEndpointBuilder>> endpointBuilderActions

    The IReadOnlyDictionary<TKey, TValue> containing the key of each endpoint and the Action<T> to be invoked to build them.

    bool preloadProducers

    Specifies whether the producers must be immediately instantiated and connected. When false the IProducer will be created only when the first message is about to be produced.

    Returns
    Type Description
    IMqttEndpointsConfigurationBuilder

    The IMqttEndpointsConfigurationBuilder so that additional calls can be chained.

    | Improve this doc View source

    AddOutbound(Type, SingleEndpointRouterFunction, IReadOnlyDictionary<string, Action<IMqttProducerEndpointBuilder>>, bool)

    Adds an outbound endpoint to produce the specified message type to a Mqtt topic.

    Declaration
    IMqttEndpointsConfigurationBuilder AddOutbound(Type messageType, DictionaryOutboundRouter<object, MqttProducerEndpoint>.SingleEndpointRouterFunction routerFunction, IReadOnlyDictionary<string, Action<IMqttProducerEndpointBuilder>> endpointBuilderActions, bool preloadProducers = true)
    Parameters
    Type Name Description
    Type messageType

    The type of the messages to be published to this endpoint.

    DictionaryOutboundRouter<object, MqttProducerEndpoint>.SingleEndpointRouterFunction routerFunction

    The DictionaryOutboundRouter<TMessage, TEndpoint>.SingleEndpointRouterFunction.

    IReadOnlyDictionary<string, Action<IMqttProducerEndpointBuilder>> endpointBuilderActions

    The IReadOnlyDictionary<TKey, TValue> containing the key of each endpoint and the Action<T> to be invoked to build them.

    bool preloadProducers

    Specifies whether the producers must be immediately instantiated and connected. When false the IProducer will be created only when the first message is about to be produced.

    Returns
    Type Description
    IMqttEndpointsConfigurationBuilder

    The IMqttEndpointsConfigurationBuilder so that additional calls can be chained.

    | Improve this doc View source

    AddOutbound(Type, Action<IMqttProducerEndpointBuilder>, bool)

    Adds an outbound endpoint to produce the specified message type to a Mqtt topic.

    Declaration
    IMqttEndpointsConfigurationBuilder AddOutbound(Type messageType, Action<IMqttProducerEndpointBuilder> endpointBuilderAction, bool preloadProducers = true)
    Parameters
    Type Name Description
    Type messageType

    The type of the messages to be published to this endpoint.

    Action<IMqttProducerEndpointBuilder> endpointBuilderAction

    An Action<T> that takes the IMqttProducerEndpointBuilder and configures it.

    bool preloadProducers

    Specifies whether the producers must be immediately instantiated and connected. When false the IProducer will be created only when the first message is about to be produced.

    Returns
    Type Description
    IMqttEndpointsConfigurationBuilder

    The IMqttEndpointsConfigurationBuilder so that additional calls can be chained.

    | Improve this doc View source

    AddOutbound<TMessage>(RouterFunction, IReadOnlyDictionary<string, Action<IMqttProducerEndpointBuilder>>, bool)

    Adds an outbound endpoint to produce the specified message type to a Mqtt topic.

    Declaration
    IMqttEndpointsConfigurationBuilder AddOutbound<TMessage>(DictionaryOutboundRouter<TMessage, MqttProducerEndpoint>.RouterFunction routerFunction, IReadOnlyDictionary<string, Action<IMqttProducerEndpointBuilder>> endpointBuilderActions, bool preloadProducers = true)
    Parameters
    Type Name Description
    DictionaryOutboundRouter<TMessage, MqttProducerEndpoint>.RouterFunction routerFunction

    The DictionaryOutboundRouter<TMessage, TEndpoint>.RouterFunction.

    IReadOnlyDictionary<string, Action<IMqttProducerEndpointBuilder>> endpointBuilderActions

    The IReadOnlyDictionary<TKey, TValue> containing the key of each endpoint and the Action<T> to be invoked to build them.

    bool preloadProducers

    Specifies whether the producers must be immediately instantiated and connected. When false the IProducer will be created only when the first message is about to be produced.

    Returns
    Type Description
    IMqttEndpointsConfigurationBuilder

    The IMqttEndpointsConfigurationBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TMessage

    The type of the messages to be published to this endpoint.

    | Improve this doc View source

    AddOutbound<TMessage>(SingleEndpointRouterFunction, IReadOnlyDictionary<string, Action<IMqttProducerEndpointBuilder>>, bool)

    Adds an outbound endpoint to produce the specified message type to a Mqtt topic.

    Declaration
    IMqttEndpointsConfigurationBuilder AddOutbound<TMessage>(DictionaryOutboundRouter<TMessage, MqttProducerEndpoint>.SingleEndpointRouterFunction routerFunction, IReadOnlyDictionary<string, Action<IMqttProducerEndpointBuilder>> endpointBuilderActions, bool preloadProducers = true)
    Parameters
    Type Name Description
    DictionaryOutboundRouter<TMessage, MqttProducerEndpoint>.SingleEndpointRouterFunction routerFunction

    The DictionaryOutboundRouter<TMessage, TEndpoint>.SingleEndpointRouterFunction.

    IReadOnlyDictionary<string, Action<IMqttProducerEndpointBuilder>> endpointBuilderActions

    The IReadOnlyDictionary<TKey, TValue> containing the key of each endpoint and the Action<T> to be invoked to build them.

    bool preloadProducers

    Specifies whether the producers must be immediately instantiated and connected. When false the IProducer will be created only when the first message is about to be produced.

    Returns
    Type Description
    IMqttEndpointsConfigurationBuilder

    The IMqttEndpointsConfigurationBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TMessage

    The type of the messages to be published to this endpoint.

    | Improve this doc View source

    AddOutbound<TMessage>(Action<IMqttProducerEndpointBuilder>, bool)

    Adds an outbound endpoint to produce the specified message type to a Mqtt topic.

    Declaration
    IMqttEndpointsConfigurationBuilder AddOutbound<TMessage>(Action<IMqttProducerEndpointBuilder> endpointBuilderAction, bool preloadProducers = true)
    Parameters
    Type Name Description
    Action<IMqttProducerEndpointBuilder> endpointBuilderAction

    An Action<T> that takes the IMqttProducerEndpointBuilder and configures it.

    bool preloadProducers

    Specifies whether the producers must be immediately instantiated and connected. When false the IProducer will be created only when the first message is about to be produced.

    Returns
    Type Description
    IMqttEndpointsConfigurationBuilder

    The IMqttEndpointsConfigurationBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TMessage

    The type of the messages to be published to this endpoint.

    | Improve this doc View source

    Configure(Action<IMqttClientConfigBuilder>)

    Configures the MQTT client properties that are shared between the producers and consumers.

    Declaration
    IMqttEndpointsConfigurationBuilder Configure(Action<IMqttClientConfigBuilder> configBuilderAction)
    Parameters
    Type Name Description
    Action<IMqttClientConfigBuilder> configBuilderAction

    An Action<T> that takes the IMqttClientConfigBuilder and configures it.

    Returns
    Type Description
    IMqttEndpointsConfigurationBuilder

    The IMqttEndpointsConfigurationBuilder so that additional calls can be chained.

    | Improve this doc View source

    Configure(Action<MqttClientConfig>)

    Configures the MQTT client properties that are shared between the producers and consumers.

    Declaration
    IMqttEndpointsConfigurationBuilder Configure(Action<MqttClientConfig> configAction)
    Parameters
    Type Name Description
    Action<MqttClientConfig> configAction

    An Action<T> that takes the MqttClientConfig and configures it.

    Returns
    Type Description
    IMqttEndpointsConfigurationBuilder

    The IMqttEndpointsConfigurationBuilder so that additional calls can be chained.

    Extension Methods

    EndpointsConfigurationBuilderAddInboundExtensions.AddInbound(IEndpointsConfigurationBuilder, IConsumerEndpoint, int)
    EndpointsConfigurationBuilderAddKafkaEndpointsExtensions.AddKafkaEndpoints(IEndpointsConfigurationBuilder, Action<IKafkaEndpointsConfigurationBuilder>)
    EndpointsConfigurationBuilderAddMqttEndpointsExtensions.AddMqttEndpoints(IEndpointsConfigurationBuilder, Action<IMqttEndpointsConfigurationBuilder>)
    EndpointsConfigurationBuilderAddOutboundExtensions.AddOutbound(IEndpointsConfigurationBuilder, Type, IProducerEndpoint, bool)
    EndpointsConfigurationBuilderAddOutboundExtensions.AddOutbound(IEndpointsConfigurationBuilder, Type, params IProducerEndpoint[])
    EndpointsConfigurationBuilderAddOutboundExtensions.AddOutbound(IEndpointsConfigurationBuilder, Type, IOutboundRouter, bool)
    EndpointsConfigurationBuilderAddOutboundExtensions.AddOutbound(IEndpointsConfigurationBuilder, Type, IEnumerable<IProducerEndpoint>, bool)
    EndpointsConfigurationBuilderAddOutboundExtensions.AddOutbound(IEndpointsConfigurationBuilder, Type, Type, bool)
    EndpointsConfigurationBuilderAddOutboundExtensions.AddOutbound<TMessage>(IEndpointsConfigurationBuilder, IProducerEndpoint, bool)
    EndpointsConfigurationBuilderAddOutboundExtensions.AddOutbound<TMessage>(IEndpointsConfigurationBuilder, params IProducerEndpoint[])
    EndpointsConfigurationBuilderAddOutboundExtensions.AddOutbound<TMessage>(IEndpointsConfigurationBuilder, IOutboundRouter<TMessage>, bool)
    EndpointsConfigurationBuilderAddOutboundExtensions.AddOutbound<TMessage>(IEndpointsConfigurationBuilder, IEnumerable<IProducerEndpoint>, bool)
    EndpointsConfigurationBuilderAddOutboundExtensions.AddOutbound<TMessage, TRouter>(IEndpointsConfigurationBuilder, bool)
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini