Class KNetConsumer<K, V, TJVMK, TJVMV>
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
-
JVMBridgeBaseJVMBridgeBase<AutoCloseable>Consumer<TJVMK, TJVMV>KafkaConsumer<TJVMK, TJVMV>KNetConsumer<K, V, TJVMK, TJVMV>
- Implements
-
IJVMBridgeCoreIJVMBridgeBaseStaticIConsumer<K, V, TJVMK, TJVMV>IConsumer<TJVMK, TJVMV>IJVMBridgeBaseIJVMBridgeDefinition
- Derived
- Inherited Members
-
JVMBridgeBase<AutoCloseable>.SExecuteWithSignature(Type, IJavaType, string, string, params object[])JVMBridgeBase<AutoCloseable>.SExecute<TReturn, TConverter>(Type, IJavaType, string, params object[])JVMBridgeBase<AutoCloseable>.IsAssignableFrom(IJavaType)JVMBridgeBase<AutoCloseable>.IsAssignableFrom<T>()JVMBridgeBase<AutoCloseable>.Execute<T>(params T[])JVMBridgeBase<AutoCloseable>.DynBridgeClazzJVMBridgeBase<AutoCloseable>.BridgeClazzJVMBridgeBase.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.IExecuteWithSignature<TNewClass, TReturn, TConverter>(string, string, params object[])JVMBridgeBase.DynBridgeInstanceJVMBridgeBase.BridgeInstanceJVMBridgeBase.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
ConsumerConfigBuilderThe 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
booltrue 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
ConsumerConfigBuilderAn instance of ConsumerConfigBuilder
useJVMCallback
booltrue to active callback based mode
Properties
BridgeClassName
https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_BridgeClassName.htm
public override string BridgeClassName { get; }
Property Value
IsCompleting
true if the IConsumer<K, V, TJVMK, TJVMV> instance is completing async operation
public bool IsCompleting { get; }
Property Value
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
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
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
longTimeout 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
longTimeout in milliseconds
Returns
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
longTimeout in milliseconds
Returns
- ConsumerRecords<K, V, TJVMK, TJVMV>
Poll(TimeSpan)
KNet extension for Poll(Duration)
public ConsumerRecords<K, V, TJVMK, TJVMV> Poll(TimeSpan timeout)
Parameters
Returns
- 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>