Consuming data from Kafka topic

After you produce data to a Kafka topic, you can consume data from the Kafka topic.

The configuration that you used previously to produce data to Kafka topics is the same that you use to consume data from Kafka topics. You need to verify that the data was written correctly to the Kafka topic and can also be read by the client.
You must have produced data to your Kafka topic.
Run the following command to consume the data produced previously:
kafka-console-consumer \
  --bootstrap-server $BROKER_HOST:9093 \
  --consumer.config client-ldap.properties \
  --topic machine-data \
  --group machine-data-1 \
  --from-beginning

You see the following output, which tells you that the client successfully read it from the topic:

Hello, Kafka!