Class MockProducerInterceptor
java.lang.Object
org.apache.kafka.test.MockProducerInterceptor
- All Implemented Interfaces:
AutoCloseable, org.apache.kafka.clients.producer.ProducerInterceptor<String,String>, org.apache.kafka.common.ClusterResourceListener, org.apache.kafka.common.Configurable
- Direct Known Subclasses:
KafkaProducerTest.MonitorableInterceptor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final AtomicIntegerstatic final AtomicReference<org.apache.kafka.common.ClusterResource> static final AtomicReference<org.apache.kafka.common.ClusterResource> static final AtomicIntegerstatic final AtomicIntegerstatic final org.apache.kafka.common.ClusterResourcestatic final AtomicIntegerstatic final AtomicIntegerstatic final AtomicIntegerstatic final AtomicIntegerstatic final AtomicIntegerstatic final AtomicIntegerstatic final AtomicInteger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidvoidonAcknowledgement(org.apache.kafka.clients.producer.RecordMetadata metadata, Exception exception) voidonUpdate(org.apache.kafka.common.ClusterResource clusterResource) static voidstatic voidsetThrowOnConfigExceptionThreshold(int value) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.clients.producer.ProducerInterceptor
onAcknowledgement
-
Field Details
-
INIT_COUNT
-
CLOSE_COUNT
-
ONSEND_COUNT
-
CONFIG_COUNT
-
THROW_CONFIG_EXCEPTION
-
THROW_ON_CONFIG_EXCEPTION_THRESHOLD
-
ON_SUCCESS_COUNT
-
ON_ERROR_COUNT
-
ON_ERROR_WITH_METADATA_COUNT
-
ON_ACKNOWLEDGEMENT_COUNT
-
CLUSTER_META
-
NO_CLUSTER_ID
public static final org.apache.kafka.common.ClusterResource NO_CLUSTER_ID -
CLUSTER_ID_BEFORE_ON_ACKNOWLEDGEMENT
public static final AtomicReference<org.apache.kafka.common.ClusterResource> CLUSTER_ID_BEFORE_ON_ACKNOWLEDGEMENT -
APPEND_STRING_PROP
- See Also:
-
-
Constructor Details
-
MockProducerInterceptor
public MockProducerInterceptor()
-
-
Method Details
-
configure
-
onSend
-
onAcknowledgement
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceorg.apache.kafka.clients.producer.ProducerInterceptor<String,String>
-
setThrowOnConfigExceptionThreshold
public static void setThrowOnConfigExceptionThreshold(int value) -
resetCounters
public static void resetCounters() -
onUpdate
public void onUpdate(org.apache.kafka.common.ClusterResource clusterResource) - Specified by:
onUpdatein interfaceorg.apache.kafka.common.ClusterResourceListener
-