From the course: Apache Kafka Essential Training: Building Scalable Applications

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Kafka clusters in action

Kafka clusters in action

- [Instructor] Having set up a cluster and created some topics, let's now publish and consume messages with this cluster and observe how Kafka scales with partitions. For use in this exercise, we have a SimpleProducer and a SimpleConsumer in the package chapter three. Let's go to the SimpleConsumer first in KafkaSimpleConsumer.java. This consumer subscribes to the kafka.learning.orders topic. It receives data from the topic and prints these messages to the console. It uses the Kafka-Java-consumer as the consumer group. Let's run this consumer now. The consumer is running, but there are no messages in Kafka, so there is nothing that is getting printed. Let's now go to the Kafdrop UI. Let's click on the Kafka.Learning.Orders topic. Now you can see the consumer group showing up here. Now Kafka is keeping track of the offsets consumed by the consumer. There are no messages in the topic partitions so there is no lag shown.…

Contents