CIS-4250/5250 Homework #6: Kafka

Due: Friday, December 14, 2018

  1. Download and unpack the Kafka sample code to Jumbo. Verify that you can compile it with Maven. Run both the producer and the consumer and verify that the sample works.

  2. (Re)create the test topic so it contains two partitions. Modify the producer so it writes all values less than 0.5 into one partition and all other values into the other partition. Modify the consumer so that it uses two threads and two RandomConsumer objects to read the two partitions simultaneously. Instead of outputting the values directly each thread should output a running average of the values it sees. If the input values are truely random the averages should converge to 0.25 for one partition and 0.75 for the other.

In a zip archive, submit to Moodle your two modified programs and your build control file if you changed it (the POM file).

Last Revised: 2018-11-14
© Copyright 2018 by Peter C. Chapin <>