Search in sources :

Example 1 with IgnoreAndProceedErrorHandler

use of org.sdase.commons.server.kafka.consumer.IgnoreAndProceedErrorHandler in project sda-dropwizard-commons by SDA-SE.

the class KafkaBundleWithConfigIT method multiTest.

@Test
public void multiTest() {
    final String TOPIC_CREATE = "create";
    final String TOPIC_DELETE = "delete";
    KAFKA.getKafkaTestUtils().createTopic(TOPIC_CREATE, 1, (short) 1);
    KAFKA.getKafkaTestUtils().createTopic(TOPIC_DELETE, 1, (short) 1);
    kafkaBundle.createMessageListener(MessageListenerRegistration.builder().withDefaultListenerConfig().forTopic(TOPIC_CREATE).withDefaultConsumer().withKeyDeserializer(new LongDeserializer()).withListenerStrategy(new SyncCommitMLS<Long, String>(record -> resultsString.add(record.value()), new IgnoreAndProceedErrorHandler<>())).build());
    kafkaBundle.createMessageListener(MessageListenerRegistration.builder().withDefaultListenerConfig().forTopic(TOPIC_DELETE).withDefaultConsumer().withListenerStrategy(new SyncCommitMLS<String, String>(record -> resultsString.add(record.value()), new IgnoreAndProceedErrorHandler<>())).build());
    MessageProducer<Long, String> createProducer = kafkaBundle.registerProducer(ProducerRegistration.<Long, String>builder().forTopic(TOPIC_CREATE).withProducerConfig(new ProducerConfig()).withKeySerializer(new LongSerializer()).build());
    MessageProducer<String, String> deleteProducer = kafkaBundle.registerProducer(ProducerRegistration.<String, String>builder().forTopic(TOPIC_DELETE).withDefaultProducer().build());
    createProducer.send(1L, "test1");
    deleteProducer.send("key", "test2");
    await().atMost(KafkaBundleConsts.N_MAX_WAIT_MS, MILLISECONDS).until(() -> resultsString.size() == 2);
    assertThat(resultsString).containsExactlyInAnyOrder("test1", "test2");
}
Also used : AutocommitMLS(org.sdase.commons.server.kafka.consumer.strategies.autocommit.AutocommitMLS) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) MessageListenerRegistration(org.sdase.commons.server.kafka.builder.MessageListenerRegistration) ListenerConfig(org.sdase.commons.server.kafka.config.ListenerConfig) ConsumerRecords(org.apache.kafka.clients.consumer.ConsumerRecords) KafkaHelper(org.sdase.commons.server.kafka.consumer.KafkaHelper) MessageListenerStrategy(org.sdase.commons.server.kafka.consumer.strategies.MessageListenerStrategy) StringDeserializer(org.apache.kafka.common.serialization.StringDeserializer) Map(java.util.Map) StringSerializer(org.apache.kafka.common.serialization.StringSerializer) ClassRule(org.junit.ClassRule) KafkaJsonSerializer(org.sdase.commons.server.kafka.serializers.KafkaJsonSerializer) TopicPartition(org.apache.kafka.common.TopicPartition) Awaitility.await(org.awaitility.Awaitility.await) AfterClass(org.junit.AfterClass) Set(java.util.Set) LongDeserializer(org.apache.kafka.common.serialization.LongDeserializer) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) UUID(java.util.UUID) LongSerializer(org.apache.kafka.common.serialization.LongSerializer) List(java.util.List) ConsumerConfig(org.sdase.commons.server.kafka.config.ConsumerConfig) ConfigOverride.config(io.dropwizard.testing.ConfigOverride.config) ConsumerRecord(org.apache.kafka.clients.consumer.ConsumerRecord) IgnoreAndProceedErrorHandler(org.sdase.commons.server.kafka.consumer.IgnoreAndProceedErrorHandler) KafkaConsumer(org.apache.kafka.clients.consumer.KafkaConsumer) ProducerConfig(org.sdase.commons.server.kafka.config.ProducerConfig) ProducerRecord(org.apache.kafka.clients.producer.ProducerRecord) BeforeClass(org.junit.BeforeClass) TestRule(org.junit.rules.TestRule) SharedKafkaTestResource(com.salesforce.kafka.test.junit4.SharedKafkaTestResource) KafkaJsonDeserializer(org.sdase.commons.server.kafka.serializers.KafkaJsonDeserializer) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) WrappedNoSerializationErrorDeserializer(org.sdase.commons.server.kafka.serializers.WrappedNoSerializationErrorDeserializer) KafkaProducer(org.apache.kafka.clients.producer.KafkaProducer) DropwizardAppRule(io.dropwizard.testing.junit.DropwizardAppRule) KafkaTestApplication(org.sdase.commons.server.kafka.dropwizard.KafkaTestApplication) ConfigurationException(org.sdase.commons.server.kafka.exception.ConfigurationException) ProducerRegistration(org.sdase.commons.server.kafka.builder.ProducerRegistration) SyncCommitMLS(org.sdase.commons.server.kafka.consumer.strategies.synccommit.SyncCommitMLS) Before(org.junit.Before) ErrorHandler(org.sdase.commons.server.kafka.consumer.ErrorHandler) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test) MessageHandler(org.sdase.commons.server.kafka.consumer.MessageHandler) RuleChain(org.junit.rules.RuleChain) AtomicLong(java.util.concurrent.atomic.AtomicLong) MessageProducer(org.sdase.commons.server.kafka.producer.MessageProducer) ResourceHelpers.resourceFilePath(io.dropwizard.testing.ResourceHelpers.resourceFilePath) MessageListener(org.sdase.commons.server.kafka.consumer.MessageListener) KafkaTestConfiguration(org.sdase.commons.server.kafka.dropwizard.KafkaTestConfiguration) Collections(java.util.Collections) SimpleEntity(org.sdase.commons.server.kafka.serializers.SimpleEntity) LongSerializer(org.apache.kafka.common.serialization.LongSerializer) LongDeserializer(org.apache.kafka.common.serialization.LongDeserializer) IgnoreAndProceedErrorHandler(org.sdase.commons.server.kafka.consumer.IgnoreAndProceedErrorHandler) AtomicLong(java.util.concurrent.atomic.AtomicLong) ProducerConfig(org.sdase.commons.server.kafka.config.ProducerConfig) Test(org.junit.Test)

Example 2 with IgnoreAndProceedErrorHandler

use of org.sdase.commons.server.kafka.consumer.IgnoreAndProceedErrorHandler in project sda-dropwizard-commons by SDA-SE.

the class KafkaBundleWithConfigIT method testJsonSerializer.

@Test
public void testJsonSerializer() {
    String topic = "testJsonSerializer";
    KAFKA.getKafkaTestUtils().createTopic(topic, 1, (short) 1);
    kafkaBundle.createMessageListener(MessageListenerRegistration.builder().withDefaultListenerConfig().forTopic(topic).withDefaultConsumer().withValueDeserializer(new KafkaJsonDeserializer<>(new ObjectMapper(), SimpleEntity.class)).withListenerStrategy(new SyncCommitMLS<>(x -> resultsString.add(x.value().getName()), new IgnoreAndProceedErrorHandler<>())).build());
    MessageProducer<Object, SimpleEntity> prod = kafkaBundle.registerProducer(ProducerRegistration.builder().forTopic(topic).withDefaultProducer().withValueSerializer(new KafkaJsonSerializer<SimpleEntity>(new ObjectMapper())).build());
    SimpleEntity a = new SimpleEntity();
    a.setName("a");
    SimpleEntity b = new SimpleEntity();
    b.setName("b");
    prod.send("Test", a);
    prod.send("Test", b);
    await().atMost(KafkaBundleConsts.N_MAX_WAIT_MS, MILLISECONDS).until(() -> resultsString.size() == 2);
    assertThat(resultsString).containsExactlyInAnyOrder("a", "b");
}
Also used : AutocommitMLS(org.sdase.commons.server.kafka.consumer.strategies.autocommit.AutocommitMLS) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) MessageListenerRegistration(org.sdase.commons.server.kafka.builder.MessageListenerRegistration) ListenerConfig(org.sdase.commons.server.kafka.config.ListenerConfig) ConsumerRecords(org.apache.kafka.clients.consumer.ConsumerRecords) KafkaHelper(org.sdase.commons.server.kafka.consumer.KafkaHelper) MessageListenerStrategy(org.sdase.commons.server.kafka.consumer.strategies.MessageListenerStrategy) StringDeserializer(org.apache.kafka.common.serialization.StringDeserializer) Map(java.util.Map) StringSerializer(org.apache.kafka.common.serialization.StringSerializer) ClassRule(org.junit.ClassRule) KafkaJsonSerializer(org.sdase.commons.server.kafka.serializers.KafkaJsonSerializer) TopicPartition(org.apache.kafka.common.TopicPartition) Awaitility.await(org.awaitility.Awaitility.await) AfterClass(org.junit.AfterClass) Set(java.util.Set) LongDeserializer(org.apache.kafka.common.serialization.LongDeserializer) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) UUID(java.util.UUID) LongSerializer(org.apache.kafka.common.serialization.LongSerializer) List(java.util.List) ConsumerConfig(org.sdase.commons.server.kafka.config.ConsumerConfig) ConfigOverride.config(io.dropwizard.testing.ConfigOverride.config) ConsumerRecord(org.apache.kafka.clients.consumer.ConsumerRecord) IgnoreAndProceedErrorHandler(org.sdase.commons.server.kafka.consumer.IgnoreAndProceedErrorHandler) KafkaConsumer(org.apache.kafka.clients.consumer.KafkaConsumer) ProducerConfig(org.sdase.commons.server.kafka.config.ProducerConfig) ProducerRecord(org.apache.kafka.clients.producer.ProducerRecord) BeforeClass(org.junit.BeforeClass) TestRule(org.junit.rules.TestRule) SharedKafkaTestResource(com.salesforce.kafka.test.junit4.SharedKafkaTestResource) KafkaJsonDeserializer(org.sdase.commons.server.kafka.serializers.KafkaJsonDeserializer) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) WrappedNoSerializationErrorDeserializer(org.sdase.commons.server.kafka.serializers.WrappedNoSerializationErrorDeserializer) KafkaProducer(org.apache.kafka.clients.producer.KafkaProducer) DropwizardAppRule(io.dropwizard.testing.junit.DropwizardAppRule) KafkaTestApplication(org.sdase.commons.server.kafka.dropwizard.KafkaTestApplication) ConfigurationException(org.sdase.commons.server.kafka.exception.ConfigurationException) ProducerRegistration(org.sdase.commons.server.kafka.builder.ProducerRegistration) SyncCommitMLS(org.sdase.commons.server.kafka.consumer.strategies.synccommit.SyncCommitMLS) Before(org.junit.Before) ErrorHandler(org.sdase.commons.server.kafka.consumer.ErrorHandler) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test) MessageHandler(org.sdase.commons.server.kafka.consumer.MessageHandler) RuleChain(org.junit.rules.RuleChain) AtomicLong(java.util.concurrent.atomic.AtomicLong) MessageProducer(org.sdase.commons.server.kafka.producer.MessageProducer) ResourceHelpers.resourceFilePath(io.dropwizard.testing.ResourceHelpers.resourceFilePath) MessageListener(org.sdase.commons.server.kafka.consumer.MessageListener) KafkaTestConfiguration(org.sdase.commons.server.kafka.dropwizard.KafkaTestConfiguration) Collections(java.util.Collections) SimpleEntity(org.sdase.commons.server.kafka.serializers.SimpleEntity) KafkaJsonDeserializer(org.sdase.commons.server.kafka.serializers.KafkaJsonDeserializer) IgnoreAndProceedErrorHandler(org.sdase.commons.server.kafka.consumer.IgnoreAndProceedErrorHandler) SimpleEntity(org.sdase.commons.server.kafka.serializers.SimpleEntity) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Example 3 with IgnoreAndProceedErrorHandler

use of org.sdase.commons.server.kafka.consumer.IgnoreAndProceedErrorHandler in project sda-dropwizard-commons by SDA-SE.

the class KafkaBundleWithConfigIT method testKafkaMessages.

@Test
public void testKafkaMessages() {
    String topic = "testKafkaMessages";
    List<String> checkMessages = new ArrayList<>();
    KAFKA.getKafkaTestUtils().createTopic(topic, 1, (short) 1);
    kafkaBundle.createMessageListener(MessageListenerRegistration.builder().withDefaultListenerConfig().forTopic(topic).withDefaultConsumer().withKeyDeserializer(new StringDeserializer()).withValueDeserializer(new StringDeserializer()).withListenerStrategy(new SyncCommitMLS<>(record -> resultsString.add(record.value()), new IgnoreAndProceedErrorHandler<>())).build());
    // pass in messages
    for (int i = 0; i < KafkaBundleConsts.N_MESSAGES; i++) {
        String message = UUID.randomUUID().toString();
        checkMessages.add(message);
        stringStringProducer.send(new ProducerRecord<>(topic, message));
    }
    await().atMost(KafkaBundleConsts.N_MAX_WAIT_MS, MILLISECONDS).until(() -> resultsString.size() == checkMessages.size());
    assertThat(resultsString).containsExactlyInAnyOrderElementsOf(checkMessages);
}
Also used : AutocommitMLS(org.sdase.commons.server.kafka.consumer.strategies.autocommit.AutocommitMLS) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) MessageListenerRegistration(org.sdase.commons.server.kafka.builder.MessageListenerRegistration) ListenerConfig(org.sdase.commons.server.kafka.config.ListenerConfig) ConsumerRecords(org.apache.kafka.clients.consumer.ConsumerRecords) KafkaHelper(org.sdase.commons.server.kafka.consumer.KafkaHelper) MessageListenerStrategy(org.sdase.commons.server.kafka.consumer.strategies.MessageListenerStrategy) StringDeserializer(org.apache.kafka.common.serialization.StringDeserializer) Map(java.util.Map) StringSerializer(org.apache.kafka.common.serialization.StringSerializer) ClassRule(org.junit.ClassRule) KafkaJsonSerializer(org.sdase.commons.server.kafka.serializers.KafkaJsonSerializer) TopicPartition(org.apache.kafka.common.TopicPartition) Awaitility.await(org.awaitility.Awaitility.await) AfterClass(org.junit.AfterClass) Set(java.util.Set) LongDeserializer(org.apache.kafka.common.serialization.LongDeserializer) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) UUID(java.util.UUID) LongSerializer(org.apache.kafka.common.serialization.LongSerializer) List(java.util.List) ConsumerConfig(org.sdase.commons.server.kafka.config.ConsumerConfig) ConfigOverride.config(io.dropwizard.testing.ConfigOverride.config) ConsumerRecord(org.apache.kafka.clients.consumer.ConsumerRecord) IgnoreAndProceedErrorHandler(org.sdase.commons.server.kafka.consumer.IgnoreAndProceedErrorHandler) KafkaConsumer(org.apache.kafka.clients.consumer.KafkaConsumer) ProducerConfig(org.sdase.commons.server.kafka.config.ProducerConfig) ProducerRecord(org.apache.kafka.clients.producer.ProducerRecord) BeforeClass(org.junit.BeforeClass) TestRule(org.junit.rules.TestRule) SharedKafkaTestResource(com.salesforce.kafka.test.junit4.SharedKafkaTestResource) KafkaJsonDeserializer(org.sdase.commons.server.kafka.serializers.KafkaJsonDeserializer) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) WrappedNoSerializationErrorDeserializer(org.sdase.commons.server.kafka.serializers.WrappedNoSerializationErrorDeserializer) KafkaProducer(org.apache.kafka.clients.producer.KafkaProducer) DropwizardAppRule(io.dropwizard.testing.junit.DropwizardAppRule) KafkaTestApplication(org.sdase.commons.server.kafka.dropwizard.KafkaTestApplication) ConfigurationException(org.sdase.commons.server.kafka.exception.ConfigurationException) ProducerRegistration(org.sdase.commons.server.kafka.builder.ProducerRegistration) SyncCommitMLS(org.sdase.commons.server.kafka.consumer.strategies.synccommit.SyncCommitMLS) Before(org.junit.Before) ErrorHandler(org.sdase.commons.server.kafka.consumer.ErrorHandler) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test) MessageHandler(org.sdase.commons.server.kafka.consumer.MessageHandler) RuleChain(org.junit.rules.RuleChain) AtomicLong(java.util.concurrent.atomic.AtomicLong) MessageProducer(org.sdase.commons.server.kafka.producer.MessageProducer) ResourceHelpers.resourceFilePath(io.dropwizard.testing.ResourceHelpers.resourceFilePath) MessageListener(org.sdase.commons.server.kafka.consumer.MessageListener) KafkaTestConfiguration(org.sdase.commons.server.kafka.dropwizard.KafkaTestConfiguration) Collections(java.util.Collections) SimpleEntity(org.sdase.commons.server.kafka.serializers.SimpleEntity) StringDeserializer(org.apache.kafka.common.serialization.StringDeserializer) IgnoreAndProceedErrorHandler(org.sdase.commons.server.kafka.consumer.IgnoreAndProceedErrorHandler) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 4 with IgnoreAndProceedErrorHandler

use of org.sdase.commons.server.kafka.consumer.IgnoreAndProceedErrorHandler in project sda-dropwizard-commons by SDA-SE.

the class KafkaBundleWithConfigIT method kafkaConsumerReceivesMessages.

@Test
public void kafkaConsumerReceivesMessages() {
    String topic = "kafkaConsumerReceivesMessages";
    KAFKA.getKafkaTestUtils().createTopic(topic, 1, (short) 1);
    StringDeserializer deserializer = new StringDeserializer();
    kafkaBundle.createMessageListener(MessageListenerRegistration.builder().withDefaultListenerConfig().forTopic(topic).withDefaultConsumer().withKeyDeserializer(deserializer).withValueDeserializer(deserializer).withListenerStrategy(new SyncCommitMLS<>(record -> resultsString.add(record.value()), new IgnoreAndProceedErrorHandler<>())).build());
    List<String> checkMessages = new ArrayList<>();
    // pass in messages
    for (int i = 0; i < KafkaBundleConsts.N_MESSAGES; i++) {
        String message = UUID.randomUUID().toString();
        checkMessages.add(message);
        stringStringProducer.send(new ProducerRecord<>(topic, message));
    }
    await().atMost(KafkaBundleConsts.N_MAX_WAIT_MS, MILLISECONDS).until(() -> resultsString.size() == checkMessages.size());
    assertThat(resultsString).containsExactlyElementsOf(checkMessages);
}
Also used : AutocommitMLS(org.sdase.commons.server.kafka.consumer.strategies.autocommit.AutocommitMLS) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) MessageListenerRegistration(org.sdase.commons.server.kafka.builder.MessageListenerRegistration) ListenerConfig(org.sdase.commons.server.kafka.config.ListenerConfig) ConsumerRecords(org.apache.kafka.clients.consumer.ConsumerRecords) KafkaHelper(org.sdase.commons.server.kafka.consumer.KafkaHelper) MessageListenerStrategy(org.sdase.commons.server.kafka.consumer.strategies.MessageListenerStrategy) StringDeserializer(org.apache.kafka.common.serialization.StringDeserializer) Map(java.util.Map) StringSerializer(org.apache.kafka.common.serialization.StringSerializer) ClassRule(org.junit.ClassRule) KafkaJsonSerializer(org.sdase.commons.server.kafka.serializers.KafkaJsonSerializer) TopicPartition(org.apache.kafka.common.TopicPartition) Awaitility.await(org.awaitility.Awaitility.await) AfterClass(org.junit.AfterClass) Set(java.util.Set) LongDeserializer(org.apache.kafka.common.serialization.LongDeserializer) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) UUID(java.util.UUID) LongSerializer(org.apache.kafka.common.serialization.LongSerializer) List(java.util.List) ConsumerConfig(org.sdase.commons.server.kafka.config.ConsumerConfig) ConfigOverride.config(io.dropwizard.testing.ConfigOverride.config) ConsumerRecord(org.apache.kafka.clients.consumer.ConsumerRecord) IgnoreAndProceedErrorHandler(org.sdase.commons.server.kafka.consumer.IgnoreAndProceedErrorHandler) KafkaConsumer(org.apache.kafka.clients.consumer.KafkaConsumer) ProducerConfig(org.sdase.commons.server.kafka.config.ProducerConfig) ProducerRecord(org.apache.kafka.clients.producer.ProducerRecord) BeforeClass(org.junit.BeforeClass) TestRule(org.junit.rules.TestRule) SharedKafkaTestResource(com.salesforce.kafka.test.junit4.SharedKafkaTestResource) KafkaJsonDeserializer(org.sdase.commons.server.kafka.serializers.KafkaJsonDeserializer) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) WrappedNoSerializationErrorDeserializer(org.sdase.commons.server.kafka.serializers.WrappedNoSerializationErrorDeserializer) KafkaProducer(org.apache.kafka.clients.producer.KafkaProducer) DropwizardAppRule(io.dropwizard.testing.junit.DropwizardAppRule) KafkaTestApplication(org.sdase.commons.server.kafka.dropwizard.KafkaTestApplication) ConfigurationException(org.sdase.commons.server.kafka.exception.ConfigurationException) ProducerRegistration(org.sdase.commons.server.kafka.builder.ProducerRegistration) SyncCommitMLS(org.sdase.commons.server.kafka.consumer.strategies.synccommit.SyncCommitMLS) Before(org.junit.Before) ErrorHandler(org.sdase.commons.server.kafka.consumer.ErrorHandler) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test) MessageHandler(org.sdase.commons.server.kafka.consumer.MessageHandler) RuleChain(org.junit.rules.RuleChain) AtomicLong(java.util.concurrent.atomic.AtomicLong) MessageProducer(org.sdase.commons.server.kafka.producer.MessageProducer) ResourceHelpers.resourceFilePath(io.dropwizard.testing.ResourceHelpers.resourceFilePath) MessageListener(org.sdase.commons.server.kafka.consumer.MessageListener) KafkaTestConfiguration(org.sdase.commons.server.kafka.dropwizard.KafkaTestConfiguration) Collections(java.util.Collections) SimpleEntity(org.sdase.commons.server.kafka.serializers.SimpleEntity) StringDeserializer(org.apache.kafka.common.serialization.StringDeserializer) IgnoreAndProceedErrorHandler(org.sdase.commons.server.kafka.consumer.IgnoreAndProceedErrorHandler) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)4 SharedKafkaTestResource (com.salesforce.kafka.test.junit4.SharedKafkaTestResource)4 ConfigOverride.config (io.dropwizard.testing.ConfigOverride.config)4 ResourceHelpers.resourceFilePath (io.dropwizard.testing.ResourceHelpers.resourceFilePath)4 DropwizardAppRule (io.dropwizard.testing.junit.DropwizardAppRule)4 ArrayList (java.util.ArrayList)4 Collections (java.util.Collections)4 HashSet (java.util.HashSet)4 List (java.util.List)4 Map (java.util.Map)4 Set (java.util.Set)4 UUID (java.util.UUID)4 MILLISECONDS (java.util.concurrent.TimeUnit.MILLISECONDS)4 AtomicLong (java.util.concurrent.atomic.AtomicLong)4 ConsumerRecord (org.apache.kafka.clients.consumer.ConsumerRecord)4 ConsumerRecords (org.apache.kafka.clients.consumer.ConsumerRecords)4 KafkaConsumer (org.apache.kafka.clients.consumer.KafkaConsumer)4 KafkaProducer (org.apache.kafka.clients.producer.KafkaProducer)4 ProducerRecord (org.apache.kafka.clients.producer.ProducerRecord)4 TopicPartition (org.apache.kafka.common.TopicPartition)4