Class KafkaConsumerEndpointConfiguration
The Kafka consumer endpoint configuration.
Inheritance
Implements
Inherited Members
Namespace: Silverback.Messaging.Configuration.Kafka
Assembly: Silverback.Integration.Kafka.dll
Syntax
public sealed record KafkaConsumerEndpointConfiguration : ConsumerEndpointConfiguration, IEquatable<EndpointConfiguration>, IEquatable<ConsumerEndpointConfiguration>, IEquatable<KafkaConsumerEndpointConfiguration>
Constructors
KafkaConsumerEndpointConfiguration()
The Kafka consumer endpoint configuration.
Declaration
public KafkaConsumerEndpointConfiguration()
Properties
EqualityContract
The Kafka consumer endpoint configuration.
Declaration
protected override Type EqualityContract { get; }
Property Value
| Type | Description |
|---|---|
| Type |
Overrides
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.
Declaration
public Func<IReadOnlyCollection<TopicPartition>, ValueTask<IEnumerable<TopicPartitionOffset>>>? PartitionOffsetsProvider { get; init; }
Property Value
| Type | Description |
|---|---|
| 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.
Declaration
public IValueReadOnlyCollection<TopicPartitionOffset> TopicPartitions { get; init; }
Property Value
| Type | Description |
|---|---|
| IValueReadOnlyCollection<TopicPartitionOffset> |
Methods
Equals(ConsumerEndpointConfiguration?)
The Kafka consumer endpoint configuration.
Declaration
public override sealed bool Equals(ConsumerEndpointConfiguration? other)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsumerEndpointConfiguration | other |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
Equals(KafkaConsumerEndpointConfiguration?)
The Kafka consumer endpoint configuration.
Declaration
public bool Equals(KafkaConsumerEndpointConfiguration? other)
Parameters
| Type | Name | Description |
|---|---|---|
| KafkaConsumerEndpointConfiguration | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object?)
The Kafka consumer endpoint configuration.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
GetHashCode()
The Kafka consumer endpoint configuration.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
PrintMembers(StringBuilder)
The Kafka consumer endpoint configuration.
Declaration
protected override bool PrintMembers(StringBuilder builder)
Parameters
| Type | Name | Description |
|---|---|---|
| StringBuilder | builder |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
ToString()
The Kafka consumer endpoint configuration.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
ValidateCore()
Validates the endpoint configuration and throws an BrokerConfigurationException if not valid.
Declaration
protected override void ValidateCore()
Overrides
Operators
operator ==(KafkaConsumerEndpointConfiguration?, KafkaConsumerEndpointConfiguration?)
The Kafka consumer endpoint configuration.
Declaration
public static bool operator ==(KafkaConsumerEndpointConfiguration? left, KafkaConsumerEndpointConfiguration? right)
Parameters
| Type | Name | Description |
|---|---|---|
| KafkaConsumerEndpointConfiguration | left | |
| KafkaConsumerEndpointConfiguration | right |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(KafkaConsumerEndpointConfiguration?, KafkaConsumerEndpointConfiguration?)
The Kafka consumer endpoint configuration.
Declaration
public static bool operator !=(KafkaConsumerEndpointConfiguration? left, KafkaConsumerEndpointConfiguration? right)
Parameters
| Type | Name | Description |
|---|---|---|
| KafkaConsumerEndpointConfiguration | left | |
| KafkaConsumerEndpointConfiguration | right |
Returns
| Type | Description |
|---|---|
| bool |