Table of Contents

About

The kafka-avro-console-producer is a producer command line to read data from standard input and write it to a Kafka topic in an avro format.

This console uses the Avro converter with the Schema Registry in order to properly write the Avro data schema.

Example

Producer

  • Start the REPL and define the schema
kafka-avro-console-producer \
  --broker-list kafkahost:29092 --topic bar \
  --property value.schema='{"type":"record","name":"myrecord","fields":[{"name":"f1","type":"string"}]}'
  • Insert data that conform to the schema
{"f1": "value1"}
{"f1": "value2"}
{"f1": "value3"}