Develop a Kafka Streams application that simulate a Currency Exchange.
Module: Kafka Streams
Duration: 30 mins
The following are some commands you can use to test your Kafka Streams application.
kafkacat -P -b :9092 -t amounts -K :
kafkacat -P -b :9092 -t rates -K :
./bin/kafka-console-consumer.sh --bootstrap-server :9092 --topic out
./bin/kafka-console-consumer.sh --bootstrap-server :9092 --topic rates --from-beginning
StreamsBuilder builder = new StreamsBuilder();
KStream<String, String> amounts = builder.stream("amounts");
KTable<String, String> rates = builder.table("rates");
KStream<String, String> out = amounts.join(rates, (amt, rate) -> "amt is " + amt * rate);
out.to("out");