/// <summary> /// Initializes a new instance of the <see cref="KafkaOutboundEndpointRouter{TMessage}" /> class. /// </summary> /// <param name="routerFunction"> /// The <see cref="DictionaryOutboundRouter{TMessage,TEndpoint}.SingleEndpointRouterFunction" />. /// </param> /// <param name="endpointBuilderActions"> /// The <see cref="IReadOnlyDictionary{TKey,TValue}" /> containing the key of each endpoint and the /// <see cref="Action{T}" /> to be invoked to build them. /// </param> /// <param name="clientConfig"> /// The <see cref="KafkaClientConfig" /> to be used to initialize the /// <see cref="KafkaProducerConfig" />. /// </param> public KafkaOutboundEndpointRouter( SingleEndpointRouterFunction routerFunction, IReadOnlyDictionary <string, Action <IKafkaProducerEndpointBuilder> > endpointBuilderActions, KafkaClientConfig?clientConfig = null) : base(routerFunction, BuildEndpointsDictionary(endpointBuilderActions, clientConfig)) { }
/// <summary> /// Initializes a new instance of the <see cref="MqttOutboundEndpointRouter{TMessage}" /> class. /// </summary> /// <param name="routerFunction"> /// The <see cref="DictionaryOutboundRouter{TMessage,TEndpoint}.SingleEndpointRouterFunction" />. /// </param> /// <param name="endpointBuilderActions"> /// The <see cref="IReadOnlyDictionary{TKey,TValue}" /> containing the key of each endpoint and the /// <see cref="Action{T}" /> to be invoked to build them. /// </param> /// <param name="clientConfig"> /// The <see cref="MqttClientConfig" />. /// </param> public MqttOutboundEndpointRouter( SingleEndpointRouterFunction routerFunction, IReadOnlyDictionary <string, Action <IMqttProducerEndpointBuilder> > endpointBuilderActions, MqttClientConfig clientConfig) : base(routerFunction, BuildEndpointsDictionary(endpointBuilderActions, clientConfig)) { }
/// <summary> /// Initializes a new instance of the <see cref="DictionaryOutboundRouter{TMessage, TEndpoint}" /> class. /// </summary> /// <param name="routerFunction"> /// The <see cref="SingleEndpointRouterFunction" />. /// </param> /// <param name="endpoints"> /// The <see cref="IReadOnlyDictionary{TKey,TValue}" /> containing the endpoints and their key. /// </param> public DictionaryOutboundRouter( SingleEndpointRouterFunction routerFunction, IReadOnlyDictionary <string, TEndpoint> endpoints) : this( (message, headers, endpointsDictionary) => new[] { routerFunction.Invoke(message, headers, endpointsDictionary) }, endpoints) { }