use of io.smallrye.reactive.messaging.kafka.base.KafkaMapBasedConfig in project smallrye-reactive-messaging by smallrye.
the class DocumentationTest method getProducerConfiguration.
private KafkaMapBasedConfig getProducerConfiguration() {
KafkaMapBasedConfig config = kafkaConfig("mp.messaging.outgoing.prices");
config.put("connector", "smallrye-kafka");
config.put("value.serializer", "org.apache.kafka.common.serialization.DoubleSerializer");
return config;
}
use of io.smallrye.reactive.messaging.kafka.base.KafkaMapBasedConfig in project smallrye-reactive-messaging by smallrye.
the class DocumentationTest method testKafkaPriceMessageProducer.
@Test
public void testKafkaPriceMessageProducer() {
ConsumerTask<String, Double> prices = companion.consumeDoubles().fromTopics("prices", 50, Duration.ofSeconds(60));
KafkaMapBasedConfig config = getProducerConfiguration();
addConfig(config);
weld.addBeanClass(KafkaPriceMessageProducer.class);
weld.disableDiscovery();
container = weld.initialize();
await().until(() -> prices.getRecords().size() >= 50);
}
use of io.smallrye.reactive.messaging.kafka.base.KafkaMapBasedConfig in project smallrye-reactive-messaging by smallrye.
the class DocumentationTest method testKafkaPriceProducer.
@Test
public void testKafkaPriceProducer() {
ConsumerTask<String, Double> prices = companion.consumeDoubles().fromTopics("prices", 50, Duration.ofSeconds(60));
KafkaMapBasedConfig config = getProducerConfiguration();
addConfig(config);
weld.addBeanClass(KafkaPriceProducer.class);
weld.disableDiscovery();
container = weld.initialize();
await().until(() -> prices.getRecords().size() >= 50);
}
use of io.smallrye.reactive.messaging.kafka.base.KafkaMapBasedConfig in project smallrye-reactive-messaging by smallrye.
the class DocumentationTest method getConsumerConfiguration.
private KafkaMapBasedConfig getConsumerConfiguration() {
KafkaMapBasedConfig config = kafkaConfig("mp.messaging.incoming.prices");
config.put("connector", "smallrye-kafka");
config.put("value.deserializer", "org.apache.kafka.common.serialization.DoubleDeserializer");
return config;
}
use of io.smallrye.reactive.messaging.kafka.base.KafkaMapBasedConfig in project smallrye-reactive-messaging by smallrye.
the class BatchFailureHandlerTest method getDeadLetterQueueConfig.
private KafkaMapBasedConfig getDeadLetterQueueConfig(String topic, String dq) {
KafkaMapBasedConfig config = kafkaConfig("mp.messaging.incoming.kafka");
config.put("topic", topic);
config.put("group.id", "batch-dead-letter-default-group");
config.put("value.deserializer", IntegerDeserializer.class.getName());
config.put("enable.auto.commit", "false");
config.put("auto.offset.reset", "earliest");
config.put("failure-strategy", "dead-letter-queue");
config.put("dead-letter-queue.topic", dq);
config.put("batch", true);
config.put("max.poll.records", 3);
return config;
}
Aggregations