Kafka – Command Line Consumer

If you have an application deployed on Docker and the application send messages to Kafka and if you want to verify the messages without running a Junit test case or Flume agent, then you can use the below command


docker exec -it KAFKA_CONTAINER_ID /opt/kafka_2.11-0.8.2.1/bin/kafka-console-consumer.sh --zookeeper ZOOKEEPER_DOMAIN_NAME:2181 --topic TOPIC_NAME --from-beginning

Advertisements