Class KafkaConsumerEndpointConfigurationBuilder<TMessage>
Builds the KafkaConsumerConfiguration.
Inheritance
Inherited Members
Namespace: Silverback.Messaging.Configuration.Kafka
Assembly: Silverback.Integration.Kafka.dll
Syntax
public class KafkaConsumerEndpointConfigurationBuilder<TMessage> : ConsumerEndpointConfigurationBuilder<TMessage, KafkaConsumerEndpointConfiguration, KafkaConsumerEndpointConfigurationBuilder<TMessage>>
Type Parameters
| Name | Description |
|---|---|
| TMessage | The type of the messages being consumed. |
Constructors
KafkaConsumerEndpointConfigurationBuilder(IServiceProvider, string?)
Initializes a new instance of the KafkaConsumerEndpointConfigurationBuilder<TMessage> class.
Declaration
public KafkaConsumerEndpointConfigurationBuilder(IServiceProvider serviceProvider, string? friendlyName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceProvider | serviceProvider | The IServiceProvider. |
| string | friendlyName | An optional friendly to be shown in the human-targeted output (e.g. logs, health checks result, etc.). |
Properties
This
Gets this instance.
Declaration
protected override KafkaConsumerEndpointConfigurationBuilder<TMessage> This { get; }
Property Value
| Type | Description |
|---|---|
| KafkaConsumerEndpointConfigurationBuilder<TMessage> |
Overrides
Remarks
This is necessary to work around casting in the base classes.
Methods
ConsumeFrom(params TopicPartitionOffset[])
Specifies the topics and partitions to be consumed, as well as the starting offsets.
Declaration
public KafkaConsumerEndpointConfigurationBuilder<TMessage> ConsumeFrom(params TopicPartitionOffset[] topicPartitionOffsets)
Parameters
| Type | Name | Description |
|---|---|---|
| TopicPartitionOffset[] | topicPartitionOffsets | The topic partitions to be consumed and their starting offset. |
Returns
| Type | Description |
|---|---|
| KafkaConsumerEndpointConfigurationBuilder<TMessage> | The KafkaConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
ConsumeFrom(params TopicPartition[])
Specifies the topics and partitions to be consumed.
Declaration
public KafkaConsumerEndpointConfigurationBuilder<TMessage> ConsumeFrom(params TopicPartition[] topicPartitions)
Parameters
| Type | Name | Description |
|---|---|---|
| TopicPartition[] | topicPartitions | The topic partitions to be consumed. |
Returns
| Type | Description |
|---|---|
| KafkaConsumerEndpointConfigurationBuilder<TMessage> | The KafkaConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
ConsumeFrom(IEnumerable<string>, Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartitionOffset>>)
Specifies the topics and a function that returns the partitions to be consumed, as well as the starting offsets.
Declaration
public KafkaConsumerEndpointConfigurationBuilder<TMessage> ConsumeFrom(IEnumerable<string> topics, Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartitionOffset>> partitionOffsetsProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | topics | The topics. |
| Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartitionOffset>> | partitionOffsetsProvider | A function that receives all available Confluent.Kafka.TopicPartition for the topics and returns the collection of Confluent.Kafka.TopicPartitionOffset containing the partitions to be consumed and their starting offsets. |
Returns
| Type | Description |
|---|---|
| KafkaConsumerEndpointConfigurationBuilder<TMessage> | The KafkaConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
ConsumeFrom(IEnumerable<string>, Func<IReadOnlyCollection<TopicPartition>, ValueTask<IEnumerable<TopicPartitionOffset>>>)
Specifies the topics and a function that returns the partitions to be consumed, as well as the starting offsets.
Declaration
public KafkaConsumerEndpointConfigurationBuilder<TMessage> ConsumeFrom(IEnumerable<string> topics, Func<IReadOnlyCollection<TopicPartition>, ValueTask<IEnumerable<TopicPartitionOffset>>> partitionOffsetsProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | topics | The topics. |
| Func<IReadOnlyCollection<TopicPartition>, ValueTask<IEnumerable<TopicPartitionOffset>>> | partitionOffsetsProvider | A function that receives all available Confluent.Kafka.TopicPartition for the topics and returns the collection of Confluent.Kafka.TopicPartitionOffset containing the partitions to be consumed and their starting offsets. |
Returns
| Type | Description |
|---|---|
| KafkaConsumerEndpointConfigurationBuilder<TMessage> | The KafkaConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
ConsumeFrom(string)
Specifies the topic to be subscribed.
Declaration
public KafkaConsumerEndpointConfigurationBuilder<TMessage> ConsumeFrom(string topic)
Parameters
| Type | Name | Description |
|---|---|---|
| string | topic | The topic. |
Returns
| Type | Description |
|---|---|
| KafkaConsumerEndpointConfigurationBuilder<TMessage> | The KafkaConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
ConsumeFrom(string, Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartitionOffset>>)
Specifies the topic and a function that returns the partitions to be consumed, as well as the starting offsets.
Declaration
public KafkaConsumerEndpointConfigurationBuilder<TMessage> ConsumeFrom(string topic, Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartitionOffset>> partitionOffsetsProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| string | topic | The topic. |
| Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartitionOffset>> | partitionOffsetsProvider | A function that receives all available Confluent.Kafka.TopicPartition for the topic and returns the collection of Confluent.Kafka.TopicPartitionOffset containing the partitions to be consumed and their starting offsets. |
Returns
| Type | Description |
|---|---|
| KafkaConsumerEndpointConfigurationBuilder<TMessage> | The KafkaConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
ConsumeFrom(string, Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartition>>)
Specifies the topic and a function that returns the partitions to be consumed.
Declaration
public KafkaConsumerEndpointConfigurationBuilder<TMessage> ConsumeFrom(string topic, Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartition>> partitionsProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| string | topic | The topic. |
| Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartition>> | partitionsProvider | A function that receives all available Confluent.Kafka.TopicPartition for the topic and returns the collection of Confluent.Kafka.TopicPartition to be consumed. |
Returns
| Type | Description |
|---|---|
| KafkaConsumerEndpointConfigurationBuilder<TMessage> | The KafkaConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
ConsumeFrom(string, params int[])
Specifies the topic partitions to be consumed.
Declaration
public KafkaConsumerEndpointConfigurationBuilder<TMessage> ConsumeFrom(string topic, params int[] partitions)
Parameters
| Type | Name | Description |
|---|---|---|
| string | topic | The topic. |
| int[] | partitions | The indexes of the partitions to be consumed. |
Returns
| Type | Description |
|---|---|
| KafkaConsumerEndpointConfigurationBuilder<TMessage> | The KafkaConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
ConsumeFrom(params string[])
Specifies the topics to be subscribed.
Declaration
public KafkaConsumerEndpointConfigurationBuilder<TMessage> ConsumeFrom(params string[] topics)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | topics | The topics to be subscribed. |
Returns
| Type | Description |
|---|---|
| KafkaConsumerEndpointConfigurationBuilder<TMessage> | The KafkaConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
ConsumeFrom(string[], Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartition>>)
Specifies the topics and a function that returns the partitions to be consumed, as well as the starting offsets.
Declaration
public KafkaConsumerEndpointConfigurationBuilder<TMessage> ConsumeFrom(string[] topics, Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartition>> partitionsProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | topics | The topics. |
| Func<IReadOnlyCollection<TopicPartition>, IEnumerable<TopicPartition>> | partitionsProvider | A function that receives all available Confluent.Kafka.TopicPartition for the topics and returns the collection of Confluent.Kafka.TopicPartition to be consumed. |
Returns
| Type | Description |
|---|---|
| KafkaConsumerEndpointConfigurationBuilder<TMessage> | The KafkaConsumerEndpointConfigurationBuilder<TMessage> so that additional calls can be chained. |
CreateConfiguration()
Creates the TConfiguration instance.
Declaration
protected override KafkaConsumerEndpointConfiguration CreateConfiguration()
Returns
| Type | Description |
|---|---|
| KafkaConsumerEndpointConfiguration | The endpoint. |