Table of Contents

Interface IConsumer<K, V, TJVMK, TJVMV>

Namespace
MASES.KNet.Consumer
Assembly
MASES.KNet.dll

KNet extension of IConsumer<K, V>

public interface IConsumer<K, V, TJVMK, TJVMV> : IConsumer<TJVMK, TJVMV>, IConsumer, IJVMBridgeBase, IJVMBridgeBaseInstance, IJVMBridgeDefinition, IDisposable, ICloseable, IAutoCloseable

Type Parameters

K

The key type

V

The value type

TJVMK

The JVM type of K

TJVMV

The JVM type of V

Inherited Members
Extension Methods

Properties

IsCompleting

true if the IConsumer<K, V, TJVMK, TJVMV> instance is completing async operation

bool IsCompleting { get; }

Property Value

bool

IsEmpty

true if the IConsumer<K, V, TJVMK, TJVMV> instance has an empty set of items in async operation

bool IsEmpty { get; }

Property Value

bool

WaitingBatches

Number of message batches in the IConsumer<K, V, TJVMK, TJVMV> instance waiting to be processed in async operation

int WaitingBatches { get; }

Property Value

int

WaitingMessages

Number of messages in the IConsumer<K, V, TJVMK, TJVMV> instance waiting to be processed in async operation

[Obsolete("Use WaitingBatches")]
int WaitingMessages { get; }

Property Value

int

Methods

Consume(long, Func<ConsumerRecord<K, V, TJVMK, TJVMV>, bool>)

KNet sync extension for Poll(Duration)

void Consume(long timeoutMs, Func<ConsumerRecord<K, V, TJVMK, TJVMV>, bool> callback)

Parameters

timeoutMs long

Timeout in milliseconds

callback Func<ConsumerRecord<K, V, TJVMK, TJVMV>, bool>

The Func<T, TResult> where receive ConsumerRecord<K, V, TJVMK, TJVMV>; return true from callback to dispose the object

ConsumeAsync(long)

KNet async extension for Poll(Duration)

bool ConsumeAsync(long timeoutMs)

Parameters

timeoutMs long

Timeout in milliseconds

Returns

bool

true if something was enqued for Async operations

Poll(long)

KNet extension for Poll(Duration)

ConsumerRecords<K, V, TJVMK, TJVMV> Poll(long timeoutMs)

Parameters

timeoutMs long

Timeout in milliseconds

Returns

ConsumerRecords<K, V, TJVMK, TJVMV>

ConsumerRecords<K, V, TJVMK, TJVMV>

Poll(TimeSpan)

KNet extension for Poll(Duration)

ConsumerRecords<K, V, TJVMK, TJVMV> Poll(TimeSpan timeout)

Parameters

timeout TimeSpan

Timeout expressed as TimeSpan

Returns

ConsumerRecords<K, V, TJVMK, TJVMV>

ConsumerRecords<K, V, TJVMK, TJVMV>

SetCallback(Func<ConsumerRecord<K, V, TJVMK, TJVMV>, bool>, Action<Exception>)

void SetCallback(Func<ConsumerRecord<K, V, TJVMK, TJVMV>, bool> cb, Action<Exception> exceptionCallback = null)

Parameters

cb Func<ConsumerRecord<K, V, TJVMK, TJVMV>, bool>

The callback Func<T, TResult>

exceptionCallback Action<Exception>

The callback receiving Exception thrown in async operations