Interface IKafkaConsumerEndpointBuilder
Builds the KafkaConsumerEndpoint.
Inherited Members
Namespace: Silverback.Messaging.Configuration.Kafka
Assembly: Silverback.Integration.Kafka.dll
Syntax
public interface IKafkaConsumerEndpointBuilder : IConsumerEndpointBuilder<IKafkaConsumerEndpointBuilder>, IEndpointBuilder<IKafkaConsumerEndpointBuilder>
Methods
| Improve this doc View sourceConfigure(Action<KafkaConsumerConfig>)
Configures the Kafka client properties.
Declaration
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. |
ConsumeFrom(params TopicPartitionOffset[])
Specifies the topics and partitions to be consumed.
Declaration
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. |
ConsumeFrom(params TopicPartition[])
Specifies the topics and partitions to be consumed.
Declaration
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. |
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
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. |
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
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. |
ConsumeFrom(params string[])
Specifies the name of the topics to be consumed.
Declaration
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. |
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
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. |
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
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. |
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
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. |
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
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. |
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
IKafkaConsumerEndpointBuilder ProcessAllPartitionsTogether()
Returns
Type | Description |
---|---|
IKafkaConsumerEndpointBuilder | The IKafkaConsumerEndpointBuilder so that additional calls can be chained. |
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
IKafkaConsumerEndpointBuilder ProcessPartitionsIndependently()
Returns
Type | Description |
---|---|
IKafkaConsumerEndpointBuilder | The IKafkaConsumerEndpointBuilder so that additional calls can be chained. |