C# Класс KafkaNet.Consumer

Provides a basic consumer of one Topic across all partitions or over a given whitelist of partitions. TODO: provide automatic offset saving when the feature is available in 0.8.2 https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-OffsetCommit/FetchAPI
Наследование: IMetadataQueries
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Consume ( CancellationToken cancellationToken = null ) : IEnumerable

Returns a blocking enumerable of messages received from Kafka.

Consumer ( ConsumerOptions options ) : KafkaNet.Model
Dispose ( ) : void
GetOffsetPosition ( ) : List

Get the current running position (offset) for all consuming partition.

Will only return data if the consumer is actively being consumed.

GetTopicFromCache ( string topic ) : KafkaNet.Protocol.Topic
GetTopicOffsetAsync ( string topic, int maxOffsets = 2, int time = -1 ) : Task>
SetOffsetPosition ( ) : void

Force reset the offset position for a specific partition to a specific offset value.

Приватные методы

Метод Описание
ConsumeTopicPartitionAsync ( string topic, int partitionId ) : Task
EnsurePartitionPollingThreads ( ) : void
FixOffsetOutOfRangeExceptionAsync ( Fetch request ) : void
HandleResponseErrors ( Fetch request, FetchResponse response ) : void

Описание методов

Consume() публичный Метод

Returns a blocking enumerable of messages received from Kafka.
public Consume ( CancellationToken cancellationToken = null ) : IEnumerable
cancellationToken System.Threading.CancellationToken
Результат IEnumerable

Consumer() публичный Метод

public Consumer ( ConsumerOptions options ) : KafkaNet.Model
options KafkaNet.Model.ConsumerOptions
Результат KafkaNet.Model

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

GetOffsetPosition() публичный Метод

Get the current running position (offset) for all consuming partition.
Will only return data if the consumer is actively being consumed.
public GetOffsetPosition ( ) : List
Результат List

GetTopicFromCache() публичный Метод

public GetTopicFromCache ( string topic ) : KafkaNet.Protocol.Topic
topic string
Результат KafkaNet.Protocol.Topic

GetTopicOffsetAsync() публичный Метод

public GetTopicOffsetAsync ( string topic, int maxOffsets = 2, int time = -1 ) : Task>
topic string
maxOffsets int
time int
Результат Task>

SetOffsetPosition() публичный Метод

Force reset the offset position for a specific partition to a specific offset value.
public SetOffsetPosition ( ) : void
Результат void