I am studing Apache Kafka Stream SPI. I am wondering is there are a way to execute asynch code inside of mapValues
method. For example to retrieve data from external store. Is there is a way to interract with Kaska Streams in event-loop reactive style?
StreamsBuilder streamsBuilder = new StreamsBuilder();
streamsBuilder
.stream("SOURCE_TOPIC", Consumed.with(Serdes.String(), Serdes.String()))
.mapValues((readOnlyKey, value) -> value.toUpperCase())
.to("DESTINATION_TOPIC", Produced.with(Serdes.String(), Serdes.String()));
var topology = streamsBuilder.build()
var kafkaStreams = new KafkaStreams(topology, properties);
how to replace this mapValues
code
value.toUpperCase()
with:
CompletableFuture.completedFuture(value.toUpperCase())
You need to sign in to view this answers
Leave feedback about this