C# Class 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
Inheritance: IMetadataQueries
Afficher le fichier Open project: gigya/KafkaNetClient Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
ConsumeTopicPartitionAsync ( string topic, int partitionId ) : Task
EnsurePartitionPollingThreads ( ) : void
FixOffsetOutOfRangeExceptionAsync ( Fetch request ) : void
HandleResponseErrors ( Fetch request, FetchResponse response ) : void

Method Details

Consume() public méthode

Returns a blocking enumerable of messages received from Kafka.
public Consume ( CancellationToken cancellationToken = null ) : IEnumerable
cancellationToken System.Threading.CancellationToken
Résultat IEnumerable

Consumer() public méthode

public Consumer ( ConsumerOptions options ) : KafkaNet.Model
options KafkaNet.Model.ConsumerOptions
Résultat KafkaNet.Model

Dispose() public méthode

public Dispose ( ) : void
Résultat void

GetOffsetPosition() public méthode

Get the current running position (offset) for all consuming partition.
Will only return data if the consumer is actively being consumed.
public GetOffsetPosition ( ) : List
Résultat List

GetTopicFromCache() public méthode

public GetTopicFromCache ( string topic ) : KafkaNet.Protocol.Topic
topic string
Résultat KafkaNet.Protocol.Topic

GetTopicOffsetAsync() public méthode

public GetTopicOffsetAsync ( string topic, int maxOffsets = 2, int time = -1 ) : Task>
topic string
maxOffsets int
time int
Résultat Task>

SetOffsetPosition() public méthode

Force reset the offset position for a specific partition to a specific offset value.
public SetOffsetPosition ( ) : void
Résultat void