Show / Hide Table of Contents

    Class KafkaConsumerEndpointBuilder

    Builds the KafkaConsumerEndpoint.

    Inheritance
    object
    EndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>
    KafkaConsumerEndpointBuilder
    Implements
    IKafkaConsumerEndpointBuilder
    IConsumerEndpointBuilder<IKafkaConsumerEndpointBuilder>
    IEndpointBuilder<IKafkaConsumerEndpointBuilder>
    Inherited Members
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.DeserializeUsing(IMessageSerializer)
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.Decrypt(EncryptionSettings)
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.OnError(IErrorPolicy)
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.OnError(Action<IErrorPolicyBuilder>)
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.EnsureExactlyOnce(IExactlyOnceStrategy)
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.EnsureExactlyOnce(Action<IExactlyOnceStrategyBuilder>)
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.EnableBatchProcessing(int, TimeSpan?)
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.WithSequenceTimeout(TimeSpan)
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.ThrowIfUnhandled()
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.IgnoreUnhandledMessages()
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.HandleTombstoneMessages()
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.SkipNullMessages()
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.UseLegacyNullMessageHandling()
    ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.Build()
    EndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.MessageType
    EndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.EndpointsConfigurationBuilder
    EndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.This
    EndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.WithName(string)
    EndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.UseSerializer(IMessageSerializer)
    EndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.WithEncryption(EncryptionSettings)
    EndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.ValidateMessage(bool)
    EndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.DisableMessageValidation()
    EndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.CreateEndpoint()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Configuration.Kafka
    Assembly: Silverback.Integration.Kafka.dll
    Syntax
    public class KafkaConsumerEndpointBuilder : ConsumerEndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>, IKafkaConsumerEndpointBuilder, IConsumerEndpointBuilder<IKafkaConsumerEndpointBuilder>, IEndpointBuilder<IKafkaConsumerEndpointBuilder>

    Constructors

    | Improve this doc View source

    KafkaConsumerEndpointBuilder(KafkaClientConfig?, Type?, IEndpointsConfigurationBuilder?)

    Initializes a new instance of the KafkaConsumerEndpointBuilder class.

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

    The KafkaClientConfig to be used to initialize the KafkaConsumerConfig.

    Type messageType

    The type of the message being consumed.

    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 IKafkaConsumerEndpointBuilder This { get; }
    Property Value
    Type Description
    IKafkaConsumerEndpointBuilder
    Overrides
    EndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.This
    Remarks

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

    Methods

    | Improve this doc View source

    Configure(Action<KafkaConsumerConfig>)

    Configures the Kafka client properties.

    Declaration
    public IKafkaConsumerEndpointBuilder Configure(Action<KafkaConsumerConfig> configAction)
    Parameters
    Type Name Description
    Action<KafkaConsumerConfig> configAction

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

    Returns
    Type Description
    IKafkaConsumerEndpointBuilder

    The IKafkaConsumerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    ConsumeFrom(params TopicPartitionOffset[])

    Specifies the topics and partitions to be consumed.

    Declaration
    public IKafkaConsumerEndpointBuilder ConsumeFrom(params TopicPartitionOffset[] topicPartitions)
    Parameters
    Type Name Description
    TopicPartitionOffset[] topicPartitions

    The topics and partitions to be consumed and the starting offset.

    Returns
    Type Description
    IKafkaConsumerEndpointBuilder

    The IKafkaConsumerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    ConsumeFrom(params TopicPartition[])

    Specifies the topics and partitions to be consumed.

    Declaration
    public IKafkaConsumerEndpointBuilder ConsumeFrom(params TopicPartition[] topicPartitions)
    Parameters
    Type Name Description
    TopicPartition[] topicPartitions

    The topics and partitions to be consumed.

    Returns
    Type Description
    IKafkaConsumerEndpointBuilder

    The IKafkaConsumerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    ConsumeFrom(string, Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartitionOffset>>)

    Specifies the name of the topic to be consumed and a function that returns the partitions to be assigned.

    Declaration
    public IKafkaConsumerEndpointBuilder ConsumeFrom(string topicName, Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartitionOffset>> topicPartitionsResolver)
    Parameters
    Type Name Description
    string topicName

    The name of the topic.

    Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartitionOffset>> topicPartitionsResolver

    A function that receives all available Confluent.Kafka.TopicPartition for the topic and returns the collection of Confluent.Kafka.TopicPartitionOffset to be assigned.

    Returns
    Type Description
    IKafkaConsumerEndpointBuilder

    The IKafkaConsumerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    ConsumeFrom(string, Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartition>>)

    Specifies the name of the topic to be consumed and a function that returns the partitions to be assigned.

    Declaration
    public IKafkaConsumerEndpointBuilder ConsumeFrom(string topicName, Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartition>> topicPartitionsResolver)
    Parameters
    Type Name Description
    string topicName

    The name of the topic.

    Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartition>> topicPartitionsResolver

    A function that receives all available Confluent.Kafka.TopicPartition for the topic and returns the collection of Confluent.Kafka.TopicPartition to be assigned.

    Returns
    Type Description
    IKafkaConsumerEndpointBuilder

    The IKafkaConsumerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    ConsumeFrom(params string[])

    Specifies the name of the topics to be consumed.

    Declaration
    public IKafkaConsumerEndpointBuilder ConsumeFrom(params string[] topicNames)
    Parameters
    Type Name Description
    string[] topicNames

    The name of the topics.

    Returns
    Type Description
    IKafkaConsumerEndpointBuilder

    The IKafkaConsumerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    ConsumeFrom(string[], Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartitionOffset>>)

    Specifies the name of the topic to be consumed and a function that returns the partitions to be assigned.

    Declaration
    public IKafkaConsumerEndpointBuilder ConsumeFrom(string[] topicNames, Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartitionOffset>> topicPartitionsResolver)
    Parameters
    Type Name Description
    string[] topicNames

    The name of the topics.

    Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartitionOffset>> topicPartitionsResolver

    A function that receives all available Confluent.Kafka.TopicPartition for the topics and returns the collection of Confluent.Kafka.TopicPartitionOffset to be assigned.

    Returns
    Type Description
    IKafkaConsumerEndpointBuilder

    The IKafkaConsumerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    ConsumeFrom(string[], Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartition>>)

    Specifies the name of the topic to be consumed and a function that returns the partitions to be assigned.

    Declaration
    public IKafkaConsumerEndpointBuilder ConsumeFrom(string[] topicNames, Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartition>> topicPartitionsResolver)
    Parameters
    Type Name Description
    string[] topicNames

    The name of the topics.

    Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartition>> topicPartitionsResolver

    A function that receives all available Confluent.Kafka.TopicPartition for the topics and returns the collection of Confluent.Kafka.TopicPartition to be assigned.

    Returns
    Type Description
    IKafkaConsumerEndpointBuilder

    The IKafkaConsumerEndpointBuilder 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 KafkaConsumerEndpoint CreateEndpoint()
    Returns
    Type Description
    KafkaConsumerEndpoint

    The endpoint.

    Overrides
    EndpointBuilder<KafkaConsumerEndpoint, IKafkaConsumerEndpointBuilder>.CreateEndpoint()
    | Improve this doc View source

    LimitBackpressure(int)

    Sets the maximum number of messages to be consumed and enqueued waiting to be processed. The limit will be applied per partition when processing the partitions independently (default). The default limit is 1.

    Declaration
    public IKafkaConsumerEndpointBuilder LimitBackpressure(int backpressureLimit)
    Parameters
    Type Name Description
    int backpressureLimit

    The maximum number of messages to be enqueued.

    Returns
    Type Description
    IKafkaConsumerEndpointBuilder

    The IKafkaConsumerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    LimitParallelism(int)

    Sets the maximum number of incoming message that can be processed concurrently. Up to a message per each subscribed partition can be processed in parallel. The default limit is 10.

    Declaration
    public IKafkaConsumerEndpointBuilder LimitParallelism(int maxDegreeOfParallelism)
    Parameters
    Type Name Description
    int maxDegreeOfParallelism

    The maximum number of incoming message that can be processed concurrently.

    Returns
    Type Description
    IKafkaConsumerEndpointBuilder

    The IKafkaConsumerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    ProcessAllPartitionsTogether()

    Specifies that all partitions must be processed together. This means that a single stream will published for the messages from all the partitions and the sequences (ChunkSequence, BatchSequence, ...) can span across the partitions.

    Declaration
    public IKafkaConsumerEndpointBuilder ProcessAllPartitionsTogether()
    Returns
    Type Description
    IKafkaConsumerEndpointBuilder

    The IKafkaConsumerEndpointBuilder so that additional calls can be chained.

    | Improve this doc View source

    ProcessPartitionsIndependently()

    Specifies that the partitions must be processed independently. This means that a stream will published per each partition and the sequences (ChunkSequence, BatchSequence, ...) cannot span across the partitions. This option is enabled by default. Use ProcessAllPartitionsTogether() to disable it.

    Declaration
    public IKafkaConsumerEndpointBuilder ProcessPartitionsIndependently()
    Returns
    Type Description
    IKafkaConsumerEndpointBuilder

    The IKafkaConsumerEndpointBuilder so that additional calls can be chained.

    Implements

    IKafkaConsumerEndpointBuilder
    IConsumerEndpointBuilder<TBuilder>
    IEndpointBuilder<TBuilder>

    Extension Methods

    ConsumerEndpointBuilderConsumeBinaryFilesExtensions.ConsumeBinaryFiles<TBuilder>(IConsumerEndpointBuilder<TBuilder>, Action<IBinaryFileMessageSerializerBuilder>?)
    ConsumerEndpointBuilderDecryptUsingExtensions.DecryptUsingAes<TBuilder>(IConsumerEndpointBuilder<TBuilder>, byte[], byte[]?)
    ConsumerEndpointBuilderDecryptUsingExtensions.DecryptUsingAes<TBuilder>(IConsumerEndpointBuilder<TBuilder>, Func<string?, byte[]>, byte[]?)
    ConsumerEndpointBuilderDeserializeJsonExtensions.DeserializeJson<TBuilder>(IConsumerEndpointBuilder<TBuilder>, Action<IJsonMessageSerializerBuilder>?)
    ConsumerEndpointBuilderDeserializeJsonUsingNewtonsoftExtensions.DeserializeJsonUsingNewtonsoft<TBuilder>(IConsumerEndpointBuilder<TBuilder>, Action<INewtonsoftJsonMessageSerializerBuilder>?)
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini