Table of Contents

Class KNetProducer<K, V, TJVMK, TJVMV>

Namespace
MASES.KNet.Producer
Assembly
MASES.KNet.dll

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
JVMBridgeBase
JVMBridgeBase<AutoCloseable>
Producer<TJVMK, TJVMV>
KafkaProducer<TJVMK, TJVMV>
KNetProducer<K, V, TJVMK, TJVMV>
Implements
IJVMBridgeCore
IJVMBridgeBaseStatic
IProducer<K, V, TJVMK, TJVMV>
IProducer<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.Dispose()
JVMBridgeBase.ToString()
JVMBridgeBase.GetHashCode()
JVMBridgeBase.Notify()
JVMBridgeBase.NotifyAll()
JVMBridgeBase.Wait()
JVMBridgeBase.DynBridgeInstance
JVMBridgeBase.BridgeInstance
JVMBridgeBase.IsBridgeListener
Extension Methods

Constructors

KNetProducer(ProducerConfigBuilder)

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

public KNetProducer(ProducerConfigBuilder configBuilder)

Parameters

configBuilder ProducerConfigBuilder

An 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 ProducerConfigBuilder

The 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

public override string BridgeClassName { get; }

Property Value

string

Methods

~KNetProducer()

Finalizer

protected ~KNetProducer()

NewRecord()

public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord()

Returns

ProducerRecord<K, V, TJVMK, TJVMV>

NewRecord(string, int, DateTime, K, V)

public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, int partition, DateTime timestamp, K key, V value)

Parameters

topic string
partition int
timestamp DateTime
key K
value V

Returns

ProducerRecord<K, V, TJVMK, TJVMV>

NewRecord(string, int, DateTime, K, V, Headers)

public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, int partition, DateTime timestamp, K key, V value, Headers headers)

Parameters

topic string
partition int
timestamp DateTime
key K
value V
headers Headers

Returns

ProducerRecord<K, V, TJVMK, TJVMV>

NewRecord(string, int, long, K, V)

public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, int partition, long timestamp, K key, V value)

Parameters

topic string
partition int
timestamp long
key K
value V

Returns

ProducerRecord<K, V, TJVMK, TJVMV>

NewRecord(string, int, long, K, V, Headers)

public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, int partition, long timestamp, K key, V value, Headers headers)

Parameters

topic string
partition int
timestamp long
key K
value V
headers Headers

Returns

ProducerRecord<K, V, TJVMK, TJVMV>

NewRecord(string, int, K, V)

public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, int partition, K key, V value)

Parameters

topic string
partition int
key K
value V

Returns

ProducerRecord<K, V, TJVMK, TJVMV>

NewRecord(string, int, K, V, Headers)

public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, int partition, K key, V value, Headers headers)

Parameters

topic string
partition int
key K
value V
headers Headers

Returns

ProducerRecord<K, V, TJVMK, TJVMV>

NewRecord(string, K, V)

public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, K key, V value)

Parameters

topic string
key K
value V

Returns

ProducerRecord<K, V, TJVMK, TJVMV>

NewRecord(string, V)

public ProducerRecord<K, V, TJVMK, TJVMV> NewRecord(string topic, V value)

Parameters

topic string
value V

Returns

ProducerRecord<K, V, TJVMK, TJVMV>

Produce(ProducerRecord<K, V, TJVMK, TJVMV>, Callback)

public Future<RecordMetadata> Produce(ProducerRecord<K, V, TJVMK, TJVMV> record, Callback cb = null)

Parameters

record ProducerRecord<K, V, TJVMK, TJVMV>
cb Callback

Returns

Future<RecordMetadata>

Produce(ProducerRecord<K, V, TJVMK, TJVMV>, Action<RecordMetadata, JVMBridgeException>)

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)

public Future<RecordMetadata> Produce(string topic, int partition, DateTime timestamp, K key, V value, Callback cb = null)

Parameters

topic string
partition int
timestamp DateTime
key K
value V
cb Callback

Returns

Future<RecordMetadata>

Produce(string, int, DateTime, K, V, Action<RecordMetadata, JVMBridgeException>)

public void Produce(string topic, int partition, DateTime timestamp, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)

Parameters

topic string
partition int
timestamp DateTime
key K
value V
action Action<RecordMetadata, JVMBridgeException>

Produce(string, int, long, K, V, Callback)

public Future<RecordMetadata> Produce(string topic, int partition, long timestamp, K key, V value, Callback cb = null)

Parameters

topic string
partition int
timestamp long
key K
value V
cb Callback

Returns

Future<RecordMetadata>

Produce(string, int, long, K, V, Action<RecordMetadata, JVMBridgeException>)

public void Produce(string topic, int partition, long timestamp, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)

Parameters

topic string
partition int
timestamp long
key K
value V
action Action<RecordMetadata, JVMBridgeException>

Produce(string, int, K, V, Callback)

public Future<RecordMetadata> Produce(string topic, int partition, K key, V value, Callback cb = null)

Parameters

topic string
partition int
key K
value V
cb Callback

Returns

Future<RecordMetadata>

Produce(string, int, K, V, Action<RecordMetadata, JVMBridgeException>)

public void Produce(string topic, int partition, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)

Parameters

topic string
partition int
key K
value V
action Action<RecordMetadata, JVMBridgeException>

Produce(string, K, V, Callback)

public Future<RecordMetadata> Produce(string topic, K key, V value, Callback cb = null)

Parameters

topic string
key K
value V
cb Callback

Returns

Future<RecordMetadata>

Produce(string, K, V, Action<RecordMetadata, JVMBridgeException>)

public void Produce(string topic, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)

Parameters

topic string
key K
value V
action Action<RecordMetadata, JVMBridgeException>

ProduceAndWait(ProducerRecord<K, V, TJVMK, TJVMV>, 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)

public void ProduceAndWait(string topic, int partition, DateTime timestamp, K key, V value, Callback cb = null)

Parameters

topic string
partition int
timestamp DateTime
key K
value V
cb Callback

ProduceAndWait(string, int, long, K, V, Callback)

public void ProduceAndWait(string topic, int partition, long timestamp, K key, V value, Callback cb = null)

Parameters

topic string
partition int
timestamp long
key K
value V
cb Callback

ProduceAndWait(string, int, K, V, Callback)

public void ProduceAndWait(string topic, int partition, K key, V value, Callback cb = null)

Parameters

topic string
partition int
key K
value V
cb Callback

ProduceAndWait(string, K, V, Callback)

public void ProduceAndWait(string topic, K key, V value, Callback cb = null)

Parameters

topic string
key K
value V
cb Callback

ProduceAsync(ProducerRecord<K, V, TJVMK, TJVMV>, Action<RecordMetadata, JVMBridgeException>)

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

Task

ProduceAsync(string, int, DateTime, K, V, Action<RecordMetadata, JVMBridgeException>)

public Task ProduceAsync(string topic, int partition, DateTime timestamp, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)

Parameters

topic string
partition int
timestamp DateTime
key K
value V
action Action<RecordMetadata, JVMBridgeException>

Returns

Task

ProduceAsync(string, int, long, K, V, Action<RecordMetadata, JVMBridgeException>)

public Task ProduceAsync(string topic, int partition, long timestamp, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)

Parameters

topic string
partition int
timestamp long
key K
value V
action Action<RecordMetadata, JVMBridgeException>

Returns

Task

ProduceAsync(string, int, K, V, Action<RecordMetadata, JVMBridgeException>)

public Task ProduceAsync(string topic, int partition, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)

Parameters

topic string
partition int
key K
value V
action Action<RecordMetadata, JVMBridgeException>

Returns

Task

ProduceAsync(string, K, V, Action<RecordMetadata, JVMBridgeException>)

public Task ProduceAsync(string topic, K key, V value, Action<RecordMetadata, JVMBridgeException> action = null)

Parameters

topic string
key K
value V
action Action<RecordMetadata, JVMBridgeException>

Returns

Task

Send(ProducerRecord<K, V, TJVMK, TJVMV>)

public Future<RecordMetadata> Send(ProducerRecord<K, V, TJVMK, TJVMV> record)

Parameters

record ProducerRecord<K, V, TJVMK, TJVMV>

Returns

Future<RecordMetadata>

Send(ProducerRecord<K, V, TJVMK, TJVMV>, Callback)

public Future<RecordMetadata> Send(ProducerRecord<K, V, TJVMK, TJVMV> record, Callback callback)

Parameters

record ProducerRecord<K, V, TJVMK, TJVMV>
callback Callback

Returns

Future<RecordMetadata>

Send(string, int, long, K, V)

public void Send(string topic, int partition, long timestamp, K key, V value)

Parameters

topic string
partition int
timestamp long
key K
value V

Send(string, int, long, K, V, Headers)

public void Send(string topic, int partition, long timestamp, K key, V value, Headers headers)

Parameters

topic string
partition int
timestamp long
key K
value V
headers Headers

Send(string, int, K, V)

public void Send(string topic, int partition, K key, V value)

Parameters

topic string
partition int
key K
value V

Send(string, int, K, V, Headers)

public void Send(string topic, int partition, K key, V value, Headers headers)

Parameters

topic string
partition int
key K
value V
headers Headers

Send(string, K, V)

public void Send(string topic, K key, V value)

Parameters

topic string
key K
value V

Send(string, V)

public void Send(string topic, V value)

Parameters

topic string
value V

SetCallback(Callback)

Set Callback into instance of IProducer<K, V>

public void SetCallback(Callback callback)

Parameters

callback Callback

The Callback