confluent-kafka-dotnet
Show / Hide Table of Contents

Class IConsumerExtensions

Common extension methods for IConsumer<TKey, TValue> implementations.

Inheritance
object
IConsumerExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Confluent.Kafka
Assembly: Confluent.Kafka.dll
Syntax
public static class IConsumerExtensions

Methods

PositionTopicPartitionOffset<TKey, TValue>(IConsumer<TKey, TValue>, TopicPartition)

Gets the current position (offset) for the specified topic / partition.

The offset field of each requested partition will be set to the offset of the last consumed message + 1, or Offset.Unset in case there was no previous message consumed by this consumer.

The returned TopicPartitionOffset contains the leader epoch too.

Declaration
public static TopicPartitionOffset PositionTopicPartitionOffset<TKey, TValue>(this IConsumer<TKey, TValue> consumer, TopicPartition partition)
Parameters
Type Name Description
IConsumer<TKey, TValue> consumer
TopicPartition partition
Returns
Type Description
TopicPartitionOffset
Type Parameters
Name Description
TKey
TValue
Exceptions
Type Condition
KafkaException

Thrown if the request failed.

In this article