Interface IMqttEndpointsConfigurationBuilder
Exposes the methods to configure the connection to Mqtt and add the inbound and outbound endpoints.
Inherited Members
Namespace: Silverback.Messaging.Configuration.Mqtt
Assembly: Silverback.Integration.MQTT.dll
Syntax
public interface IMqttEndpointsConfigurationBuilder : IEndpointsConfigurationBuilder
Methods
| Improve this doc View sourceAddInbound(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.
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.
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.
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 |
Returns
Type | Description |
---|---|
IMqttEndpointsConfigurationBuilder | The IMqttEndpointsConfigurationBuilder so that additional calls can be chained. |
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 |
Returns
Type | Description |
---|---|
IMqttEndpointsConfigurationBuilder | The IMqttEndpointsConfigurationBuilder so that additional calls can be chained. |
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 |
Returns
Type | Description |
---|---|
IMqttEndpointsConfigurationBuilder | The IMqttEndpointsConfigurationBuilder so that additional calls can be chained. |
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 |
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. |
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 |
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. |
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 |
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. |
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. |
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. |