Class KafkaConsumerEndpointConfiguration
- Namespace
- Silverback.Messaging.Configuration.Kafka
- Assembly
- Silverback.Integration.Kafka.dll
The Kafka consumer endpoint configuration.
public sealed record KafkaConsumerEndpointConfiguration : ConsumerEndpointConfiguration, IEquatable<EndpointConfiguration>, IEquatable<ConsumerEndpointConfiguration>, IEquatable<KafkaConsumerEndpointConfiguration>
- Inheritance
-
KafkaConsumerEndpointConfiguration
- Implements
- Inherited Members
Constructors
KafkaConsumerEndpointConfiguration()
public KafkaConsumerEndpointConfiguration()
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
PartitionOffsetsProvider
Gets a function that receives all available Confluent.Kafka.TopicPartition for the topic(s) and returns the collection of Confluent.Kafka.TopicPartitionOffset containing the partitions to be consumed and their starting offsets.
public Func<IReadOnlyCollection<TopicPartition>, ValueTask<IEnumerable<TopicPartitionOffset>>>? PartitionOffsetsProvider { get; init; }
Property Value
- Func<IReadOnlyCollection<TopicPartition>, ValueTask<IEnumerable<TopicPartitionOffset>>>
TopicPartitions
Gets the topics and partitions to be consumed.
Setting the partition to Confluent.Kafka.Partition.Any for a topic will cause it to be subscribed to get a partition assignment from the message broker, unless a PartitionOffsetsProvider is set. An IKafkaPartitionsAssignedCallback can be registered to interact with the partitions assignment process.
Setting the partition to Confluent.Kafka.Partition.Any for a topic and setting a PartitionOffsetsProvider will cause the consumer to retrieve the topics metadata, collect all available partitions and call the specified resolver function. The result of the function will be used as static partition assignment for the consumer.
Setting the offset to Confluent.Kafka.Offset.Unset means that the offset stored on the message broker will be used. If no
offset was stored on the server the Configuration.AutoOffsetReset property will determine where to start consuming.
public IValueReadOnlyCollection<TopicPartitionOffset> TopicPartitions { get; init; }
Property Value
- IValueReadOnlyCollection<TopicPartitionOffset>
Methods
Equals(ConsumerEndpointConfiguration?)
public override sealed bool Equals(ConsumerEndpointConfiguration? other)
Parameters
Returns
Equals(KafkaConsumerEndpointConfiguration?)
public bool Equals(KafkaConsumerEndpointConfiguration? other)
Parameters
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
ValidateCore()
Validates the endpoint configuration and throws an BrokerConfigurationException if not valid.
protected override void ValidateCore()
Operators
operator ==(KafkaConsumerEndpointConfiguration?, KafkaConsumerEndpointConfiguration?)
public static bool operator ==(KafkaConsumerEndpointConfiguration? left, KafkaConsumerEndpointConfiguration? right)
Parameters
Returns
operator !=(KafkaConsumerEndpointConfiguration?, KafkaConsumerEndpointConfiguration?)
public static bool operator !=(KafkaConsumerEndpointConfiguration? left, KafkaConsumerEndpointConfiguration? right)