Class KafkaConsumerHelper
java.lang.Object
net.bugreaper.modules.kafka.setup.KafkaConsumerHelper
- Direct Known Subclasses:
Kafka
Kafka consumer helper responsible for consuming messages from Kafka topics.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final KafkaAdminHelperprotected intDefault await timeout for tests, in milliseconds.protected intDefault await polling interval in milliseconds for tests.protected final Stringprotected intDefault consumer timeout in milliseconds.protected intDefault maximum number of messages consumed by a grab operation.protected booleanEnables reversing consumed messages in the list so that newer messages are checked first.protected booleanEnables using a unique consumer group ID for each test run. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertCountInTopicMethod(String topic, int expectedCount, int awaitMs) consumer()protected net.bugreaper.core.assertable.AssertableStringListprotected intgetTopicMessageCountMethod(String topic) protected net.bugreaper.core.assertable.AssertableStringListgrabMessagesFromTopicMethod(String topic, String key) protected voidseeTopicIsEmptyMethod(String topic, int awaitMs) protected voidseeTopicIsNotEmptyMethod(String topic, int awaitMs)
-
Field Details
-
bootStrapServer
-
adminClient
-
awaitMs
protected volatile int awaitMsDefault await timeout for tests, in milliseconds. -
awaitPollInterval
protected volatile int awaitPollIntervalDefault await polling interval in milliseconds for tests. -
consumerTimeoutMs
protected volatile int consumerTimeoutMsDefault consumer timeout in milliseconds. -
maxConsumedMessages
protected volatile int maxConsumedMessagesDefault maximum number of messages consumed by a grab operation. -
uniqueConsumerGroup
protected volatile boolean uniqueConsumerGroupEnables using a unique consumer group ID for each test run. -
reverseMessages
protected volatile boolean reverseMessagesEnables reversing consumed messages in the list so that newer messages are checked first.
-
-
Constructor Details
-
KafkaConsumerHelper
-
-
Method Details
-
consumer
-
grabMessagesFromTopicMethod
-
getAllTopicsNamesMethod
protected net.bugreaper.core.assertable.AssertableStringList getAllTopicsNamesMethod() -
getTopicMessageCountMethod
-
assertCountInTopicMethod
-
seeTopicIsNotEmptyMethod
-
seeTopicIsEmptyMethod
-