Class KafkaConsumerExtensions
- Namespace
- MASES.KNet.Extensions
- Assembly
- MASES.KNet.dll
Extension for KafkaConsumer
public static class KafkaConsumerExtensions
- Inheritance
-
KafkaConsumerExtensions
- Inherited Members
Methods
ConsumeAsync<K, V>(IConsumer<K, V>)
Execute the consume in async mode
public static Task<ConsumerRecords<K, V>> ConsumeAsync<K, V>(this IConsumer<K, V> consumer)
Parameters
consumer
IConsumer<K, V>The consumer instance
Returns
- Task<ConsumerRecords<K, V>>
The ConsumerRecords<K, V> received
Type Parameters
K
The key type
V
The value type
Consume<K, V>(IConsumer<K, V>, CancellationToken)
Consumes ConsumerRecord from an instance of IConsumer<K, V>
public static ConsumerRecords<K, V> Consume<K, V>(this IConsumer<K, V> consumer, CancellationToken token)
Parameters
consumer
IConsumer<K, V>The consumer instance
token
CancellationTokenThe CancellationToken to use to abort waiting
Returns
- ConsumerRecords<K, V>
The ConsumerRecords<K, V> received
Type Parameters
K
The key type
V
The value type