Table of Contents

Class MockProducer<K, V>

Namespace
Org.Apache.Kafka.Clients.Producer
Assembly
MASES.KNet.dll
public class MockProducer<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>
MockProducer<K, V>
Implements
IJVMBridgeCore
IJVMBridgeBaseStatic
IProducer<K, V>
IJVMBridgeBase
IJVMBridgeDefinition
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

MockProducer()

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

public MockProducer()

MockProducer(Cluster, bool, Partitioner, Serializer<K>, Serializer<V>)

public MockProducer(Cluster arg0, bool arg1, Partitioner arg2, Serializer<K> arg3, Serializer<V> arg4)

Parameters

arg0 Cluster

Cluster

arg1 bool

bool

arg2 Partitioner

Partitioner

arg3 Serializer<K>

Serializer

arg4 Serializer<V>

Serializer

MockProducer(Cluster, bool, Serializer<K>, Serializer<V>)

public MockProducer(Cluster arg0, bool arg1, Serializer<K> arg2, Serializer<V> arg3)

Parameters

arg0 Cluster

Cluster

arg1 bool

bool

arg2 Serializer<K>

Serializer

arg3 Serializer<V>

Serializer

MockProducer(bool, Partitioner, Serializer<K>, Serializer<V>)

public MockProducer(bool arg0, Partitioner arg1, Serializer<K> arg2, Serializer<V> arg3)

Parameters

arg0 bool

bool

arg1 Partitioner

Partitioner

arg2 Serializer<K>

Serializer

arg3 Serializer<V>

Serializer

MockProducer(bool, Serializer<K>, Serializer<V>)

public MockProducer(bool arg0, Serializer<K> arg1, Serializer<V> arg2)

Parameters

arg0 bool

bool

arg1 Serializer<K>

Serializer

arg2 Serializer<V>

Serializer

MockProducer(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 MockProducer(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

abortTransactionException

public RuntimeException abortTransactionException { get; set; }

Property Value

RuntimeException

beginTransactionException

public RuntimeException beginTransactionException { get; set; }

Property Value

RuntimeException

closeException

public RuntimeException closeException { get; set; }

Property Value

RuntimeException

commitTransactionException

public RuntimeException commitTransactionException { get; set; }

Property Value

RuntimeException

flushException

public RuntimeException flushException { get; set; }

Property Value

RuntimeException

initTransactionException

public RuntimeException initTransactionException { get; set; }

Property Value

RuntimeException

partitionsForException

public RuntimeException partitionsForException { get; set; }

Property Value

RuntimeException

sendException

public RuntimeException sendException { get; set; }

Property Value

RuntimeException

sendOffsetsToTransactionException

public RuntimeException sendOffsetsToTransactionException { get; set; }

Property Value

RuntimeException

Methods

AbortTransaction()

public void AbortTransaction()

Exceptions

ProducerFencedException

BeginTransaction()

public void BeginTransaction()

Exceptions

ProducerFencedException

Clear()

public void Clear()

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

Closed()

public bool Closed()

Returns

bool

bool

CommitCount()

public long CommitCount()

Returns

long

long

CommitTransaction()

public void CommitTransaction()

Exceptions

ProducerFencedException

CompleteNext()

public bool CompleteNext()

Returns

bool

bool

ConsumerGroupOffsetsHistory()

public List<Map<String, Map<TopicPartition, OffsetAndMetadata>>> ConsumerGroupOffsetsHistory()

Returns

List<Map<String, Map<TopicPartition, OffsetAndMetadata>>>

List

DisableTelemetry()

public void DisableTelemetry()

ErrorNext(JVMBridgeException)

public bool ErrorNext(JVMBridgeException arg0)

Parameters

arg0 JVMBridgeException

RuntimeException

Returns

bool

bool

FenceProducer()

public void FenceProducer()

Flush()

public void Flush()

Flushed()

public bool Flushed()

Returns

bool

bool

History()

public List<ProducerRecord<K, V>> History()

Returns

List<ProducerRecord<K, V>>

List

InitTransactions()

public void InitTransactions()

InjectTimeoutException(int)

public void InjectTimeoutException(int arg0)

Parameters

arg0 int

int

Metrics()

public Map<MetricName, Metric> Metrics()

Returns

Map<MetricName, Metric>

Map

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

SentOffsets()

public bool SentOffsets()

Returns

bool

bool

SetClientInstanceId(Uuid)

public void SetClientInstanceId(Uuid arg0)

Parameters

arg0 Uuid

Uuid

SetMockMetrics(MetricName, Metric)

public void SetMockMetrics(MetricName arg0, Metric arg1)

Parameters

arg0 MetricName

MetricName

arg1 Metric

Metric

TransactionAborted()

public bool TransactionAborted()

Returns

bool

bool

TransactionCommitted()

public bool TransactionCommitted()

Returns

bool

bool

TransactionInFlight()

public bool TransactionInFlight()

Returns

bool

bool

TransactionInitialized()

public bool TransactionInitialized()

Returns

bool

bool

UncommittedOffsets()

public Map<String, Map<TopicPartition, OffsetAndMetadata>> UncommittedOffsets()

Returns

Map<String, Map<TopicPartition, OffsetAndMetadata>>

Map

UncommittedRecords()

public List<ProducerRecord<K, V>> UncommittedRecords()

Returns

List<ProducerRecord<K, V>>

List

Operators

implicit operator MockProducer(MockProducer<K, V>)

Converter from MockProducer<K, V> to MockProducer

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

Parameters

t MockProducer<K, V>

Returns

MockProducer