Class KafkaAvroClient
java.lang.Object
dev.lydtech.component.framework.client.kafka.KafkaAvroClient
-
Method Summary
Modifier and TypeMethodDescriptionconsumeAndAssert(String testName, org.apache.kafka.clients.consumer.Consumer consumer, int expectedEventCount, int furtherPolls) Defers to the method in KafkaClient.consumeAndAssert(String testName, org.apache.kafka.clients.consumer.Consumer consumer, int expectedEventCount, int furtherPolls, int awaitAtMostSeconds) Defers to the method in KafkaClient.org.apache.kafka.clients.consumer.ConsumercreateConsumer(String groupId, String topic) Create a standard Avro Producer.createProducer(Properties additionalConfig) Create a Producer with additional config.static KafkaAvroClientorg.apache.kafka.clients.producer.RecordMetadatasendMessage(String topic, String key, Object payload) Send a message synchronously without headers and with the default Avro Producer.org.apache.kafka.clients.producer.RecordMetadataSend a message synchronously with the provided headers and with the default Avro Producer.Future<org.apache.kafka.clients.producer.RecordMetadata>sendMessageAsync(String topic, String key, Object payload) Send a message asynchronously without headers and with the default Avro Producer.Future<org.apache.kafka.clients.producer.RecordMetadata>Send a message asynchronously with the provided headers and with the default Avro Producer.
-
Method Details
-
getInstance
-
createProducer
Create a standard Avro Producer. -
createConsumer
-
consumeAndAssert
public <T> List<org.apache.kafka.clients.consumer.ConsumerRecord<String,T>> consumeAndAssert(String testName, org.apache.kafka.clients.consumer.Consumer consumer, int expectedEventCount, int furtherPolls) throws Exception Defers to the method in KafkaClient.- Throws:
Exception
-
consumeAndAssert
public <T> List<org.apache.kafka.clients.consumer.ConsumerRecord<String,T>> consumeAndAssert(String testName, org.apache.kafka.clients.consumer.Consumer consumer, int expectedEventCount, int furtherPolls, int awaitAtMostSeconds) throws Exception Defers to the method in KafkaClient.- Throws:
Exception
-
createProducer
public org.apache.kafka.clients.producer.KafkaProducer<Long,String> createProducer(Properties additionalConfig) Create a Producer with additional config. -
sendMessage
public org.apache.kafka.clients.producer.RecordMetadata sendMessage(String topic, String key, Object payload) throws Exception Send a message synchronously without headers and with the default Avro Producer.- Throws:
Exception
-
sendMessage
public org.apache.kafka.clients.producer.RecordMetadata sendMessage(String topic, String key, Object payload, Map<String, String> headers) throws ExceptionSend a message synchronously with the provided headers and with the default Avro Producer.- Throws:
Exception
-
sendMessageAsync
public Future<org.apache.kafka.clients.producer.RecordMetadata> sendMessageAsync(String topic, String key, Object payload) Send a message asynchronously without headers and with the default Avro Producer. -
sendMessageAsync
public Future<org.apache.kafka.clients.producer.RecordMetadata> sendMessageAsync(String topic, String key, Object payload, Map<String, String> headers) Send a message asynchronously with the provided headers and with the default Avro Producer.
-