From the course: Apache Kafka Essential Training: Getting Started (2021)

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Using console consumer

Using console consumer

From the course: Apache Kafka Essential Training: Getting Started (2021)

Start my 1-month free trial

Using console consumer

- [Instructor] How do I consume messages from Kafka? We can use the Kafka-console.consumer.sh shell script for that. The command takes the mandatory bootstrap server parameter. The same considerations we discussed in the earlier video apply here, too. We need to provide a list of topics to consume data from. We have the option to either consume all the messages by using the front beginning parameter or only consume newly created messages. Let's execute this now. For demo purposes, I have four windows open. There are two producers windows on the left, and two consumer windows on the right. As seen in the previous videos, we create separate shell sessions on the container using the same docker exec command and then navigate to the Kafka bin directory. In both the producer shells, we start the Kafka producer for the given topic. In the first consumer shell, let me start the consumer and consume data from the beginning.…

Contents