/metricKafkaClient

A kafka demo. `metric` is not relevant here, fyi.

Primary LanguageJava

Kafka

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.

References

  1. Kafka, Spark, and Avro - Part 1, Kafka 101

  2. Kafka, Spark, and Avro - Part 2, Consuming Kafka messages with Spark

  3. Kafka, Spark, and Avro - Part 3, Producing and consuming Avro messages

  4. Apache Kafka for Beginners

  5. Running Kafka at Scale