Table of Contents

Class KNetConsumer<K, V, TJVMK, TJVMV>

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

KNet extension of KafkaConsumer<K, V>

public class KNetConsumer<K, V, TJVMK, TJVMV> : KafkaConsumer<TJVMK, TJVMV>, IDynamicMetaObjectProvider, IJVMBridgeCore, IJVMBridgeBaseStatic, IConsumer<K, V, TJVMK, TJVMV>, IConsumer<TJVMK, TJVMV>, IConsumer, IJVMBridgeBase, 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

Inheritance
JVMBridgeBase
JVMBridgeBase<AutoCloseable>
Consumer<TJVMK, TJVMV>
KafkaConsumer<TJVMK, TJVMV>
KNetConsumer<K, V, TJVMK, TJVMV>
Implements
IJVMBridgeCore
IJVMBridgeBaseStatic
IConsumer<K, V, TJVMK, TJVMV>
IConsumer<TJVMK, TJVMV>
IJVMBridgeBase
IJVMBridgeDefinition
Derived
Inherited Members
JVMBridgeBase<AutoCloseable>.IsAssignableFrom(IJavaType)
JVMBridgeBase<AutoCloseable>.IsAssignableFrom<T>()
JVMBridgeBase<AutoCloseable>.Execute<T>(params T[])
JVMBridgeBase<AutoCloseable>.DynBridgeClazz
JVMBridgeBase<AutoCloseable>.BridgeClazz
JVMBridgeBase.RuntimeClassNameOf<T>()
JVMBridgeBase.ClassNameOf<T>()
JVMBridgeBase.ClassOf<T>()
JVMBridgeBase.WrapsDirect<TNewClass>(IJavaObject)
JVMBridgeBase.Wraps<TNewClass>(IJavaObject)
JVMBridgeBase.Wraps<TNewClass, TReturn>(IJavaObject)
JVMBridgeBase.Wraps<TNewClass, TReturn, TConverter>(IJavaObject)
JVMBridgeBase.MonitorEnter()
JVMBridgeBase.MonitorExit()
JVMBridgeBase.IsInstanceOf(IJavaType)
JVMBridgeBase.IsInstanceOf<T>()
JVMBridgeBase.RuntimeIsInstanceOf<T>()
JVMBridgeBase.CastTo<TNewClass>()
JVMBridgeBase.CastDirect<TNewClass>()
JVMBridgeBase.ToString()
JVMBridgeBase.GetHashCode()
JVMBridgeBase.Notify()
JVMBridgeBase.NotifyAll()
JVMBridgeBase.Wait()
JVMBridgeBase.DynBridgeInstance
JVMBridgeBase.BridgeInstance
JVMBridgeBase.IsBridgeListener
Extension Methods

Constructors

KNetConsumer(ConsumerConfigBuilder, ISerDes<K, TJVMK>, ISerDes<V, TJVMV>, bool)

Initialize a new instance of KNetConsumer<K, V, TJVMK, TJVMV>

public KNetConsumer(ConsumerConfigBuilder props, ISerDes<K, TJVMK> keyDeserializer, ISerDes<V, TJVMV> valueDeserializer, bool useJVMCallback = false)

Parameters

props ConsumerConfigBuilder

The properties to use, see ConsumerConfigBuilder

keyDeserializer ISerDes<K, TJVMK>

Key serializer base on SerDes<T, TJVMT>

valueDeserializer ISerDes<V, TJVMV>

Value serializer base on SerDes<T, TJVMT>

useJVMCallback bool

true to active callback based mode

KNetConsumer(ConsumerConfigBuilder, bool)

Initialize a new instance of KNetConsumer<K, V, TJVMK, TJVMV>

public KNetConsumer(ConsumerConfigBuilder configBuilder, bool useJVMCallback = false)

Parameters

configBuilder ConsumerConfigBuilder

An instance of ConsumerConfigBuilder

useJVMCallback bool

true to active callback based mode

Properties

BridgeClassName

public override string BridgeClassName { get; }

Property Value

string

IsCompleting

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

public 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

public bool IsEmpty { get; }

Property Value

bool

WaitingMessages

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

public int WaitingMessages { get; }

Property Value

int

Methods

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

KNet sync extension for Poll(Duration)

public void Consume(long timeoutMs, Action<ConsumerRecord<K, V, TJVMK, TJVMV>> callback)

Parameters

timeoutMs long

Timeout in milliseconds

callback Action<ConsumerRecord<K, V, TJVMK, TJVMV>>

The Action<T> where receives ConsumerRecord<K, V, TJVMK, TJVMV>

ConsumeAsync(long)

KNet async extension for Poll(Duration)

public bool ConsumeAsync(long timeoutMs)

Parameters

timeoutMs long

Timeout in milliseconds

Returns

bool

true if something was enqued for Async operations

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public override void Dispose()

~KNetConsumer()

Finalizer

protected ~KNetConsumer()

Poll(long)

KNet extension for Poll(Duration)

public 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)

public 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(Action<ConsumerRecord<K, V, TJVMK, TJVMV>>)

Sets the Action<T> to use to receive ConsumerRecord<K, V, TJVMK, TJVMV>

public void SetCallback(Action<ConsumerRecord<K, V, TJVMK, TJVMV>> cb)

Parameters

cb Action<ConsumerRecord<K, V, TJVMK, TJVMV>>

The callback Action<T>