Table of Contents

Class KafkaProducer<K, V>

Namespace
Org.Apache.Kafka.Clients.Producer
Assembly
MASES.KNet.dll
public class KafkaProducer<K, V> : Producer<K, V>, IDynamicMetaObjectProvider, IJVMBridgeCore, IJVMBridgeBaseStatic, IProducer<K, V>, IProducer, IJVMBridgeBase, IJVMBridgeDefinition, IDisposable, ICloseable, IAutoCloseable

Type Parameters

K
V
Inheritance
JVMBridgeBase
JVMBridgeBase<AutoCloseable>
Producer<K, V>
KafkaProducer<K, V>
Implements
IJVMBridgeCore
IJVMBridgeBaseStatic
IProducer<K, V>
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

KafkaProducer()

Default constructor: even if the corresponding Java class does not have one, it is mandatory for JCOBridge

public KafkaProducer()

KafkaProducer(Map<String, object>)

public KafkaProducer(Map<String, object> arg0)

Parameters

arg0 Map<String, object>

Map

KafkaProducer(Map<String, object>, Serializer<K>, Serializer<V>)

public KafkaProducer(Map<String, object> arg0, Serializer<K> arg1, Serializer<V> arg2)

Parameters

arg0 Map<String, object>

Map

arg1 Serializer<K>

Serializer

arg2 Serializer<V>

Serializer

KafkaProducer(Properties)

public KafkaProducer(Properties arg0)

Parameters

arg0 Properties

Properties

KafkaProducer(Properties, Serializer<K>, Serializer<V>)

public KafkaProducer(Properties arg0, Serializer<K> arg1, Serializer<V> arg2)

Parameters

arg0 Properties

Properties

arg1 Serializer<K>

Serializer

arg2 Serializer<V>

Serializer

KafkaProducer(params object[])

Generic constructor: it is useful for JCOBridge when there is a derived class which needs to pass arguments to the highest JVMBridgeBase class

public KafkaProducer(params object[] args)

Parameters

args object[]

Properties

BridgeClassName

public override string BridgeClassName { get; }

Property Value

string

IsBridgeAbstract

public override bool IsBridgeAbstract { get; }

Property Value

bool

IsBridgeCloseable

public override bool IsBridgeCloseable { get; }

Property Value

bool

IsBridgeInterface

public override bool IsBridgeInterface { get; }

Property Value

bool

IsBridgeStatic

public override bool IsBridgeStatic { get; }

Property Value

bool

NETWORK_THREAD_PREFIX

public static String NETWORK_THREAD_PREFIX { get; }

Property Value

String

PRODUCER_METRIC_GROUP_NAME

public static String PRODUCER_METRIC_GROUP_NAME { get; }

Property Value

String

Methods

AbortTransaction()

public void AbortTransaction()

Exceptions

ProducerFencedException

BeginTransaction()

public void BeginTransaction()

Exceptions

ProducerFencedException

ClientInstanceId(Duration)

public Uuid ClientInstanceId(Duration arg0)

Parameters

arg0 Duration

Duration

Returns

Uuid

Uuid

Close()

public void Close()

Close(Duration)

public void Close(Duration arg0)

Parameters

arg0 Duration

Duration

CommitTransaction()

public void CommitTransaction()

Exceptions

ProducerFencedException

Flush()

public void Flush()

InitTransactions()

public void InitTransactions()

Metrics<ReturnExtendsOrg_Apache_Kafka_Common_Metric>()

public Map<MetricName, ReturnExtendsOrg_Apache_Kafka_Common_Metric> Metrics<ReturnExtendsOrg_Apache_Kafka_Common_Metric>() where ReturnExtendsOrg_Apache_Kafka_Common_Metric : Metric

Returns

Map<MetricName, ReturnExtendsOrg_Apache_Kafka_Common_Metric>

Map

Type Parameters

ReturnExtendsOrg_Apache_Kafka_Common_Metric

Metric

PartitionsFor(String)

public List<PartitionInfo> PartitionsFor(String arg0)

Parameters

arg0 String

String

Returns

List<PartitionInfo>

List

Send(ProducerRecord<K, V>)

public Future<RecordMetadata> Send(ProducerRecord<K, V> arg0)

Parameters

arg0 ProducerRecord<K, V>

ProducerRecord

Returns

Future<RecordMetadata>

Future

Send(ProducerRecord<K, V>, Callback)

public Future<RecordMetadata> Send(ProducerRecord<K, V> arg0, Callback arg1)

Parameters

arg0 ProducerRecord<K, V>

ProducerRecord

arg1 Callback

Callback

Returns

Future<RecordMetadata>

Future

SendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata>, ConsumerGroupMetadata)

public void SendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> arg0, ConsumerGroupMetadata arg1)

Parameters

arg0 Map<TopicPartition, OffsetAndMetadata>

Map

arg1 ConsumerGroupMetadata

ConsumerGroupMetadata

Exceptions

ProducerFencedException

Operators

implicit operator KafkaProducer(KafkaProducer<K, V>)

public static implicit operator KafkaProducer(KafkaProducer<K, V> t)

Parameters

t KafkaProducer<K, V>

Returns

KafkaProducer