Search in sources :

Example 86 with KafkaMapBasedConfig

use of io.smallrye.reactive.messaging.kafka.base.KafkaMapBasedConfig in project smallrye-reactive-messaging by smallrye.

the class BatchConsumerTest method testIncomingConsumingListPayload.

@Test
void testIncomingConsumingListPayload() {
    KafkaMapBasedConfig config = kafkaConfig("mp.messaging.incoming.kafka").put("value.deserializer", StringDeserializer.class.getName()).put("auto.offset.reset", "earliest").put("topic", topic).put("batch", true);
    BeanConsumingListPayload bean = runApplication(config, BeanConsumingListPayload.class);
    companion.produceStrings().usingGenerator(i -> new ProducerRecord<>(topic, null, "v-" + i), 10);
    await().until(() -> bean.messages().size() == 10);
    assertThat(bean.messages()).hasSize(10).allSatisfy(p -> assertThat(p).startsWith("v-"));
}
Also used : KafkaMapBasedConfig(io.smallrye.reactive.messaging.kafka.base.KafkaMapBasedConfig) Test(org.junit.jupiter.api.Test)

Aggregations

KafkaMapBasedConfig (io.smallrye.reactive.messaging.kafka.base.KafkaMapBasedConfig)86 Test (org.junit.jupiter.api.Test)56 Message (org.eclipse.microprofile.reactive.messaging.Message)34 RecordHeader (org.apache.kafka.common.header.internals.RecordHeader)30 StringSerializer (org.apache.kafka.common.serialization.StringSerializer)25 StringDeserializer (org.apache.kafka.common.serialization.StringDeserializer)22 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)20 JsonObject (io.vertx.core.json.JsonObject)19 ArrayList (java.util.ArrayList)18 KafkaConnectorIncomingConfiguration (io.smallrye.reactive.messaging.kafka.KafkaConnectorIncomingConfiguration)17 KafkaConnectorOutgoingConfiguration (io.smallrye.reactive.messaging.kafka.KafkaConnectorOutgoingConfiguration)17 KafkaSink (io.smallrye.reactive.messaging.kafka.impl.KafkaSink)17 IncomingKafkaCloudEventMetadata (io.smallrye.reactive.messaging.kafka.IncomingKafkaCloudEventMetadata)14 IntegerDeserializer (org.apache.kafka.common.serialization.IntegerDeserializer)14 IntegerSerializer (org.apache.kafka.common.serialization.IntegerSerializer)13 JsonObjectDeserializer (io.vertx.kafka.client.serialization.JsonObjectDeserializer)5 Header (org.apache.kafka.common.header.Header)5 HealthReport (io.smallrye.reactive.messaging.health.HealthReport)4 KafkaCompanionTestBase (io.smallrye.reactive.messaging.kafka.base.KafkaCompanionTestBase)3 List (java.util.List)3