Show / Hide Table of Contents

    Interface IKafkaEndpointsConfigurationBuilder

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

    Inherited Members
    IEndpointsConfigurationBuilder.ServiceProvider
    Namespace: Silverback.Messaging.Configuration.Kafka
    Assembly: Silverback.Integration.Kafka.dll
    Syntax
    public interface IKafkaEndpointsConfigurationBuilder : IEndpointsConfigurationBuilder

    Methods

    | Improve this doc View source

    AddInbound(Action<IKafkaConsumerEndpointBuilder>, int)

    Adds an inbound endpoint and instantiates a KafkaConsumer to consume from a Kafka topic.

    Declaration
    IKafkaEndpointsConfigurationBuilder AddInbound(Action<IKafkaConsumerEndpointBuilder> endpointBuilderAction, int consumersCount = 1)
    Parameters
    Type Name Description
    Action<IKafkaConsumerEndpointBuilder> endpointBuilderAction

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

    int consumersCount

    The number of consumers to be instantiated. The default is 1.

    Returns
    Type Description
    IKafkaEndpointsConfigurationBuilder

    The IKafkaEndpointsConfigurationBuilder 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 KafkaConsumerEndpoint 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<IKafkaConsumerEndpointBuilder>, int)

    Adds an inbound endpoint and instantiates a KafkaConsumer to consume from a Kafka topic.

    Declaration
    IKafkaEndpointsConfigurationBuilder AddInbound(Type? messageType, Action<IKafkaConsumerEndpointBuilder> endpointBuilderAction, int consumersCount = 1)
    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<IKafkaConsumerEndpointBuilder> endpointBuilderAction

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

    int consumersCount

    The number of consumers to be instantiated. The default is 1.

    Returns
    Type Description
    IKafkaEndpointsConfigurationBuilder

    The IKafkaEndpointsConfigurationBuilder 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 KafkaConsumerEndpoint 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<IKafkaConsumerEndpointBuilder>, int)

    Adds an inbound endpoint and instantiates a KafkaConsumer to consume from a Kafka topic.

    Declaration
    IKafkaEndpointsConfigurationBuilder AddInbound<TMessage>(Action<IKafkaConsumerEndpointBuilder> endpointBuilderAction, int consumersCount = 1)
    Parameters
    Type Name Description
    Action<IKafkaConsumerEndpointBuilder> endpointBuilderAction

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

    int consumersCount

    The number of consumers to be instantiated. The default is 1.

    Returns
    Type Description
    IKafkaEndpointsConfigurationBuilder

    The IKafkaEndpointsConfigurationBuilder 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 KafkaConsumerEndpoint 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<IKafkaProducerEndpointBuilder>>, bool)

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

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

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

    DictionaryOutboundRouter<object, KafkaProducerEndpoint>.RouterFunction routerFunction

    The DictionaryOutboundRouter<TMessage, TEndpoint>.RouterFunction.

    IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>> 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
    IKafkaEndpointsConfigurationBuilder

    The IKafkaEndpointsConfigurationBuilder so that additional calls can be chained.

    | Improve this doc View source

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

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

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

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

    DictionaryOutboundRouter<object, KafkaProducerEndpoint>.SingleEndpointRouterFunction routerFunction

    The DictionaryOutboundRouter<TMessage, TEndpoint>.SingleEndpointRouterFunction.

    IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>> 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
    IKafkaEndpointsConfigurationBuilder

    The IKafkaEndpointsConfigurationBuilder so that additional calls can be chained.

    | Improve this doc View source

    AddOutbound(Type, Action<IKafkaProducerEndpointBuilder>, bool)

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

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

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

    Action<IKafkaProducerEndpointBuilder> endpointBuilderAction

    An Action<T> that takes the IKafkaProducerEndpointBuilder 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
    IKafkaEndpointsConfigurationBuilder

    The IKafkaEndpointsConfigurationBuilder so that additional calls can be chained.

    | Improve this doc View source

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

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

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

    The DictionaryOutboundRouter<TMessage, TEndpoint>.RouterFunction.

    IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>> 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
    IKafkaEndpointsConfigurationBuilder

    The IKafkaEndpointsConfigurationBuilder 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<IKafkaProducerEndpointBuilder>>, bool)

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

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

    The DictionaryOutboundRouter<TMessage, TEndpoint>.SingleEndpointRouterFunction.

    IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>> 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
    IKafkaEndpointsConfigurationBuilder

    The IKafkaEndpointsConfigurationBuilder 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<IKafkaProducerEndpointBuilder>, bool)

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

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

    An Action<T> that takes the IKafkaProducerEndpointBuilder 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
    IKafkaEndpointsConfigurationBuilder

    The IKafkaEndpointsConfigurationBuilder 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<KafkaClientConfig>)

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

    Declaration
    IKafkaEndpointsConfigurationBuilder Configure(Action<KafkaClientConfig> configAction)
    Parameters
    Type Name Description
    Action<KafkaClientConfig> configAction

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

    Returns
    Type Description
    IKafkaEndpointsConfigurationBuilder

    The IKafkaEndpointsConfigurationBuilder 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