Class MockConsumerInterceptor
java.lang.Object
org.apache.kafka.test.MockConsumerInterceptor
- All Implemented Interfaces:
AutoCloseable, org.apache.kafka.clients.consumer.ConsumerInterceptor<String,String>, org.apache.kafka.common.ClusterResourceListener, org.apache.kafka.common.Configurable
- Direct Known Subclasses:
KafkaConsumerTest.MonitorableInterceptor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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 AtomicInteger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidvoidonCommit(Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets) voidonUpdate(org.apache.kafka.common.ClusterResource clusterResource) static voidstatic voidsetThrowOnConfigExceptionThreshold(int value)
-
Field Details
-
INIT_COUNT
-
CLOSE_COUNT
-
ON_COMMIT_COUNT
-
CONFIG_COUNT
-
THROW_CONFIG_EXCEPTION
-
THROW_ON_CONFIG_EXCEPTION_THRESHOLD
-
CLUSTER_META
-
NO_CLUSTER_ID
public static final org.apache.kafka.common.ClusterResource NO_CLUSTER_ID -
CLUSTER_ID_BEFORE_ON_CONSUME
public static final AtomicReference<org.apache.kafka.common.ClusterResource> CLUSTER_ID_BEFORE_ON_CONSUME
-
-
Constructor Details
-
MockConsumerInterceptor
public MockConsumerInterceptor()
-
-
Method Details
-
configure
-
onConsume
-
onCommit
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceorg.apache.kafka.clients.consumer.ConsumerInterceptor<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
-