Class KNetProducer<K, V, TJVMK, TJVMV>
Extends KafkaProducer adding less intrusive methods which performs better in high throughput applications
public class KNetProducer<K, V, TJVMK, TJVMV> : KafkaProducer<TJVMK, TJVMV>, IDynamicMetaObjectProvider, IJVMBridgeCore, IJVMBridgeBaseStatic, IProducer<K, V, TJVMK, TJVMV>, IProducer<TJVMK, TJVMV>, IProducer, IJVMBridgeBase, IJVMBridgeDefinition, IDisposable, ICloseable, IAutoCloseable
Type Parameters
K
Same meaning of KafkaProducer
V
Same meaning of KafkaProducer
TJVMK
The JVM type of
K
TJVMV
The JVM type of
V
- Inheritance
-
JVMBridgeBaseJVMBridgeBase<AutoCloseable>Producer<TJVMK, TJVMV>KafkaProducer<TJVMK, TJVMV>KNetProducer<K, V, TJVMK, TJVMV>
- Implements
-
IJVMBridgeCoreIJVMBridgeBaseStaticIProducer<K, V, TJVMK, TJVMV>IProducer<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.Dispose()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
KNetProducer(ProducerConfigBuilder)
Initialize a new instance of KNetProducer<K, V, TJVMK, TJVMV>
public KNetProducer(ProducerConfigBuilder configBuilder)
Parameters
configBuilder
ProducerConfigBuilderAn instance of ProducerConfigBuilder
KNetProducer(ProducerConfigBuilder, ISerDes<K, TJVMK>, ISerDes<V, TJVMV>)
Initialize a new instance of KNetProducer<K, V, TJVMK, TJVMV>
public KNetProducer(ProducerConfigBuilder props, ISerDes<K, TJVMK> keySerializer, ISerDes<V, TJVMV> valueSerializer)
Parameters
props
ProducerConfigBuilderThe properties to use, see ProducerConfigBuilder
keySerializer
ISerDes<K, TJVMK>Key serializer base on SerDes<T, TJVMT>
valueSerializer
ISerDes<V, TJVMV>Value serializer base on SerDes<T, TJVMT>
Properties
BridgeClassName
https://www.jcobridge.com/api-clr/html/P_MASES_JCOBridge_C2JBridge_JVMBridgeBase_BridgeClassName.htm
public override string BridgeClassName { get; }
Property Value
Methods
~KNetProducer()
Finalizer
protected ~KNetProducer()
NewRecord()
Initialize a new ProducerRecord<K, V, TJVMK, TJVMV>
public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord()
Returns
- ProducerRecord<K, V, TJVMK, TJVMV>
NewRecord(string, int, DateTime, K, V)
Initialize a new ProducerRecord<K, V, TJVMK, TJVMV>
public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, int partition, DateTime timestamp, K key, V value)
Parameters
Returns
- ProducerRecord<K, V, TJVMK, TJVMV>
NewRecord(string, int, DateTime, K, V, Headers)
Initialize a new ProducerRecord<K, V, TJVMK, TJVMV>
public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, int partition, DateTime timestamp, K key, V value, Headers headers)
Parameters
Returns
- ProducerRecord<K, V, TJVMK, TJVMV>
NewRecord(string, int, long, K, V)
Initialize a new ProducerRecord<K, V, TJVMK, TJVMV>
public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, int partition, long timestamp, K key, V value)
Parameters
Returns
- ProducerRecord<K, V, TJVMK, TJVMV>
NewRecord(string, int, long, K, V, Headers)
Initialize a new ProducerRecord<K, V, TJVMK, TJVMV>
public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, int partition, long timestamp, K key, V value, Headers headers)
Parameters
Returns
- ProducerRecord<K, V, TJVMK, TJVMV>
NewRecord(string, int, K, V)
Initialize a new ProducerRecord<K, V, TJVMK, TJVMV>
public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, int partition, K key, V value)
Parameters
Returns
- ProducerRecord<K, V, TJVMK, TJVMV>
NewRecord(string, int, K, V, Headers)
Initialize a new ProducerRecord<K, V, TJVMK, TJVMV>
public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, int partition, K key, V value, Headers headers)
Parameters
Returns
- ProducerRecord<K, V, TJVMK, TJVMV>
NewRecord(string, K, V)
Initialize a new ProducerRecord<K, V, TJVMK, TJVMV>
public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, K key, V value)
Parameters
topic
stringkey
Kvalue
V
Returns
- ProducerRecord<K, V, TJVMK, TJVMV>
NewRecord(string, V)
Initialize a new ProducerRecord<K, V, TJVMK, TJVMV>
public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, V value)
Parameters
topic
stringvalue
V
Returns
- ProducerRecord<K, V, TJVMK, TJVMV>
Produce(ProducerRecord<K, V, TJVMK, TJVMV>, Callback)
KNet version of Send(ProducerRecord<K, V>, Callback)
public Future<RecordMetadata> Produce(ProducerRecord<K, V, TJVMK, TJVMV> record, Callback cb = null)
Parameters
record
ProducerRecord<K, V, TJVMK, TJVMV>cb
Callback
Returns
Produce(ProducerRecord<K, V, TJVMK, TJVMV>, Action<RecordMetadata, JVMBridgeException>)
KNet version of Send(ProducerRecord<K, V>, Callback)
public void Produce(ProducerRecord<K, V, TJVMK, TJVMV> record, Action<RecordMetadata, JVMBridgeException> action = null)
Parameters
record
ProducerRecord<K, V, TJVMK, TJVMV>action
Action<RecordMetadata, JVMBridgeException>
Produce(string, int, DateTime, K, V, Callback)
KNet version of Send(ProducerRecord<K, V>, Callback)
public Future<RecordMetadata> Produce(string topic, int partition, DateTime timestamp, K key, V value, Callback cb = null)
Parameters
Returns
Produce(string, int, DateTime, K, V, Action<RecordMetadata, JVMBridgeException>)
KNet version of Send(ProducerRecord<K, V>, Callback)
public void Produce(string topic, int partition, DateTime timestamp, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)
Parameters
topic
stringpartition
inttimestamp
DateTimekey
Kvalue
Vaction
Action<RecordMetadata, JVMBridgeException>
Produce(string, int, long, K, V, Callback)
KNet version of Send(ProducerRecord<K, V>, Callback)
public Future<RecordMetadata> Produce(string topic, int partition, long timestamp, K key, V value, Callback cb = null)
Parameters
Returns
Produce(string, int, long, K, V, Action<RecordMetadata, JVMBridgeException>)
KNet version of Send(ProducerRecord<K, V>, Callback)
public void Produce(string topic, int partition, long timestamp, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)
Parameters
topic
stringpartition
inttimestamp
longkey
Kvalue
Vaction
Action<RecordMetadata, JVMBridgeException>
Produce(string, int, K, V, Callback)
KNet version of Send(ProducerRecord<K, V>, Callback)
public Future<RecordMetadata> Produce(string topic, int partition, K key, V value, Callback cb = null)
Parameters
Returns
Produce(string, int, K, V, Action<RecordMetadata, JVMBridgeException>)
KNet version of Send(ProducerRecord<K, V>, Callback)
public void Produce(string topic, int partition, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)
Parameters
topic
stringpartition
intkey
Kvalue
Vaction
Action<RecordMetadata, JVMBridgeException>
Produce(string, K, V, Callback)
KNet version of Send(ProducerRecord<K, V>, Callback)
public Future<RecordMetadata> Produce(string topic, K key, V value, Callback cb = null)
Parameters
Returns
Produce(string, K, V, Action<RecordMetadata, JVMBridgeException>)
KNet version of Send(ProducerRecord<K, V>, Callback)
public void Produce(string topic, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)
Parameters
topic
stringkey
Kvalue
Vaction
Action<RecordMetadata, JVMBridgeException>
ProduceAndWait(ProducerRecord<K, V, TJVMK, TJVMV>, Callback)
KNet version of Send(ProducerRecord<K, V>, Callback)
public void ProduceAndWait(ProducerRecord<K, V, TJVMK, TJVMV> record, Callback cb = null)
Parameters
record
ProducerRecord<K, V, TJVMK, TJVMV>cb
Callback
ProduceAndWait(string, int, DateTime, K, V, Callback)
KNet version of Send(ProducerRecord<K, V>, Callback)
public void ProduceAndWait(string topic, int partition, DateTime timestamp, K key, V value, Callback cb = null)
Parameters
ProduceAndWait(string, int, long, K, V, Callback)
KNet version of Send(ProducerRecord<K, V>, Callback)
public void ProduceAndWait(string topic, int partition, long timestamp, K key, V value, Callback cb = null)
Parameters
ProduceAndWait(string, int, K, V, Callback)
KNet version of Send(ProducerRecord<K, V>, Callback)
public void ProduceAndWait(string topic, int partition, K key, V value, Callback cb = null)
Parameters
ProduceAndWait(string, K, V, Callback)
KNet version of Send(ProducerRecord<K, V>, Callback)
public void ProduceAndWait(string topic, K key, V value, Callback cb = null)
Parameters
ProduceAsync(ProducerRecord<K, V, TJVMK, TJVMV>, Action<RecordMetadata, JVMBridgeException>)
KNet version of Send(ProducerRecord<K, V>, Callback)
public Task ProduceAsync(ProducerRecord<K, V, TJVMK, TJVMV> record, Action<RecordMetadata, JVMBridgeException> action = null)
Parameters
record
ProducerRecord<K, V, TJVMK, TJVMV>action
Action<RecordMetadata, JVMBridgeException>
Returns
ProduceAsync(string, int, DateTime, K, V, Action<RecordMetadata, JVMBridgeException>)
KNet version of Send(ProducerRecord<K, V>, Callback)
public Task ProduceAsync(string topic, int partition, DateTime timestamp, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)
Parameters
topic
stringpartition
inttimestamp
DateTimekey
Kvalue
Vaction
Action<RecordMetadata, JVMBridgeException>
Returns
ProduceAsync(string, int, long, K, V, Action<RecordMetadata, JVMBridgeException>)
KNet version of Send(ProducerRecord<K, V>, Callback)
public Task ProduceAsync(string topic, int partition, long timestamp, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)
Parameters
topic
stringpartition
inttimestamp
longkey
Kvalue
Vaction
Action<RecordMetadata, JVMBridgeException>
Returns
ProduceAsync(string, int, K, V, Action<RecordMetadata, JVMBridgeException>)
KNet version of Send(ProducerRecord<K, V>, Callback)
public Task ProduceAsync(string topic, int partition, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)
Parameters
topic
stringpartition
intkey
Kvalue
Vaction
Action<RecordMetadata, JVMBridgeException>
Returns
ProduceAsync(string, K, V, Action<RecordMetadata, JVMBridgeException>)
KNet version of Send(ProducerRecord<K, V>, Callback)
public Task ProduceAsync(string topic, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)
Parameters
topic
stringkey
Kvalue
Vaction
Action<RecordMetadata, JVMBridgeException>
Returns
Send(ProducerRecord<K, V, TJVMK, TJVMV>)
KNet version of Send(ProducerRecord<K, V>)
public Future<RecordMetadata> Send(ProducerRecord<K, V, TJVMK, TJVMV> record)
Parameters
record
ProducerRecord<K, V, TJVMK, TJVMV>
Returns
Send(ProducerRecord<K, V, TJVMK, TJVMV>, Callback)
KNet version of Send(ProducerRecord<K, V>, Callback)
public Future<RecordMetadata> Send(ProducerRecord<K, V, TJVMK, TJVMV> record, Callback callback)
Parameters
record
ProducerRecord<K, V, TJVMK, TJVMV>callback
Callback
Returns
Send(string, int, long, K, V)
KNet version of Send(ProducerRecord<K, V>)
public void Send(string topic, int partition, long timestamp, K key, V value)
Parameters
Send(string, int, long, K, V, Headers)
KNet version of Send(ProducerRecord<K, V>)
public void Send(string topic, int partition, long timestamp, K key, V value, Headers headers)
Parameters
Send(string, int, K, V)
KNet version of Send(ProducerRecord<K, V>)
public void Send(string topic, int partition, K key, V value)
Parameters
Send(string, int, K, V, Headers)
KNet version of Send(ProducerRecord<K, V>)
public void Send(string topic, int partition, K key, V value, Headers headers)
Parameters
Send(string, K, V)
KNet version of Send(ProducerRecord<K, V>)
public void Send(string topic, K key, V value)
Parameters
topic
stringkey
Kvalue
V
Send(string, V)
KNet version of Send(ProducerRecord<K, V>)
public void Send(string topic, V value)
Parameters
topic
stringvalue
V
SetCallback(Callback)
Set Callback into instance of IProducer<K, V>
public void SetCallback(Callback callback)