This is a simple demo of Kafka.
Both of the producer and consumer adopt a StringSerializer
, 'cause both of the key and value of the record is of string type. You'll need Avro to deal with much complicated cases.
The consumer plays with auto-commit mechanism, or you could replace it with seek
instead.