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
파일 보기 프로젝트 열기: gigya/KafkaNetClient 1 사용 예제들

공개 메소드들

메소드 설명
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