Consuming data from Kafka topic
After you produce data to a Kafka topic, you can consume data from the 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!